diff options
author | mtm <mtm@FreeBSD.org> | 2003-07-03 13:28:53 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-07-03 13:28:53 +0000 |
commit | fa35478dfe8e5268d7fb4da151147ab3de075bef (patch) | |
tree | 2c713b63854a634dd128726765c1adda8eaa7bd9 /lib | |
parent | 696003930f4cf50aed01980371a7b2d62cbf76c0 (diff) | |
download | FreeBSD-src-fa35478dfe8e5268d7fb4da151147ab3de075bef.zip FreeBSD-src-fa35478dfe8e5268d7fb4da151147ab3de075bef.tar.gz |
_pthread_mutex_trylock() is another internal libc function that must block
signals.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/thread/thr_mutex.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index ee615c3..e47fb60 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -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); } |