_pthread_mutex_trylock() is another internal libc function that must block
signals.
This commit is contained in:
parent
696003930f
commit
fa35478dfe
@ -301,11 +301,16 @@ __pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Libc internal.
|
||||
*/
|
||||
int
|
||||
_pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
_thread_sigblock();
|
||||
|
||||
if (mutex == NULL)
|
||||
ret = EINVAL;
|
||||
|
||||
@ -317,6 +322,9 @@ _pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
(ret = mutex_init(mutex, 1)) == 0)
|
||||
ret = mutex_lock_common(mutex, 1);
|
||||
|
||||
if (ret != 0)
|
||||
_thread_sigunblock();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user