diff options
author | David Leonard <d@cvs.openbsd.org> | 1998-11-20 12:13:33 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1998-11-20 12:13:33 +0000 |
commit | d5a877b31b8aa64095b3ccba2dadc3f45ba6c88b (patch) | |
tree | efa55bed35e52415146a7a9bf15203ace814b7ac /lib/libpthread/uthread/uthread_mutex.c | |
parent | f547068f88348f54941dc06da46491f99701933e (diff) |
sync with freebsd
Diffstat (limited to 'lib/libpthread/uthread/uthread_mutex.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_mutex.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/libpthread/uthread/uthread_mutex.c b/lib/libpthread/uthread/uthread_mutex.c index 4f4aa8af041..a7e8dfee6b5 100644 --- a/lib/libpthread/uthread/uthread_mutex.c +++ b/lib/libpthread/uthread/uthread_mutex.c @@ -257,11 +257,10 @@ pthread_mutex_lock(pthread_mutex_t * mutex) */ _thread_queue_enq(&(*mutex)->m_queue, _thread_run); - /* Unlock the mutex structure: */ - _SPINUNLOCK(&(*mutex)->lock); - - /* Block signals: */ - _thread_kern_sched_state(PS_MUTEX_WAIT, __FILE__, __LINE__); + /* Wait for the mutex: */ + _thread_kern_sched_state_unlock( + PS_MUTEX_WAIT, &(*mutex)->lock, + __FILE__, __LINE__); /* Lock the mutex again: */ _SPINLOCK(&(*mutex)->lock); @@ -290,11 +289,10 @@ pthread_mutex_lock(pthread_mutex_t * mutex) */ _thread_queue_enq(&(*mutex)->m_queue, _thread_run); - /* Unlock the mutex structure: */ - _SPINUNLOCK(&(*mutex)->lock); - - /* Block signals: */ - _thread_kern_sched_state(PS_MUTEX_WAIT, __FILE__, __LINE__); + /* Wait for the mutex: */ + _thread_kern_sched_state_unlock( + PS_MUTEX_WAIT, &(*mutex)->lock, + __FILE__, __LINE__); /* Lock the mutex again: */ _SPINLOCK(&(*mutex)->lock); |