From 99e8ecc5759668fd3af379eaddd70b4ae50ecd7f Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 5 Jul 2001 11:57:32 +0000 Subject: Added new routines from POSIX 1003.1j. This is alpha level code. * spin.c: New module implementing spin locks. * barrier.c: New module implementing barriers. * pthread.h (_POSIX_SPIN_LOCKS): defined. (_POSIX_BARRIERS): Defined. (pthread_spin_*): Defined. (pthread_barrier*): Defined. (PTHREAD_BARRIER_SERIAL_THREAD): Defined. * implement.h (pthread_spinlock_t_): Defined. (pthread_barrier_t_): Defined. (pthread_barrierattr_t_): Defined. * mutex.c (pthread_mutex_lock): Return with the error if an auto-initialiser initialisation fails. * nonportable.c (pthread_getprocessors_np): New; gets the number of available processors for the current process. --- mutex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mutex.c') diff --git a/mutex.c b/mutex.c index 0396e5f..22a7e7b 100644 --- a/mutex.c +++ b/mutex.c @@ -632,7 +632,10 @@ pthread_mutex_lock(pthread_mutex_t *mutex) */ if (*mutex == (pthread_mutex_t) PTW32_OBJECT_AUTO_INIT) { - result = ptw32_mutex_check_need_init(mutex); + if ((result = ptw32_mutex_check_need_init(mutex)) != 0) + { + return(result); + } } mx = *mutex; -- cgit v1.2.3