Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.4
-
All
Description
Hi, developers, I found an inconsistent code in below code. The lock LOCK_sigwait could be relased and not released in below code, which is correct?
int sigwait(sigset_t *setp, int *sigp) |
{
|
...;
|
 |
pthread_mutex_lock(&LOCK_sigwait);
|
for (;;) |
{
|
...;
|
pthread_mutex_unlock(&LOCK_sigwait); // release the lock before return |
return 0; |
}
|
}
|
pthread_cond_wait(&COND_sigwait, &LOCK_sigwait);
|
}
|
return 0; // do not release the lock before return |
}
|
|