diff options
| author | Mike Makonnen <mtm@FreeBSD.org> | 2003-05-31 14:38:22 +0000 |
|---|---|---|
| committer | Mike Makonnen <mtm@FreeBSD.org> | 2003-05-31 14:38:22 +0000 |
| commit | 6e1aa51e9e0951277be41e890df0725099ae38ae (patch) | |
| tree | 2ce2b27d372050112f9145ef69d1d4516c19b15e /lib/libthr/thread/thr_mutex.c | |
| parent | e07f1d5fd72491f8b5f6aaffba8a9d4ebfe7b7ad (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
| -rw-r--r-- | lib/libthr/thread/thr_mutex.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 5267a32b83d0..50ece6161e6a 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -269,25 +269,23 @@ _pthread_mutex_destroy(pthread_mutex_t * mutex) static int init_static(pthread_mutex_t *mutex) { + int error = 0; _SPINLOCK(&static_init_lock); - if (*mutex == PTHREAD_MUTEX_INITIALIZER) { - _SPINUNLOCK(&static_init_lock); - return(_pthread_mutex_init(mutex, NULL)); - } + if (*mutex == PTHREAD_MUTEX_INITIALIZER) + error = _pthread_mutex_init(mutex, NULL); _SPINUNLOCK(&static_init_lock); - return (0); + return (error); } static int init_static_private(pthread_mutex_t *mutex) { + int error = 0; _SPINLOCK(&static_init_lock); - if (*mutex == PTHREAD_MUTEX_INITIALIZER) { - _SPINUNLOCK(&static_init_lock); - return (_pthread_mutex_init(mutex, &static_mattr)); - } + if (*mutex == PTHREAD_MUTEX_INITIALIZER) + error = _pthread_mutex_init(mutex, &static_mattr); _SPINUNLOCK(&static_init_lock); - return (0); + return (error); } int |
