|
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
|
}
|
|
https://github.com/MariaDB/server/blob/57f14eab20ae2733eb341f3d293515a10a40bc48/mysys/my_pthread.c#L250-L295
|