summaryrefslogtreecommitdiff
path: root/mutex.c
diff options
context:
space:
mode:
authorrpj <rpj>2001-07-05 11:57:32 +0000
committerrpj <rpj>2001-07-05 11:57:32 +0000
commit99e8ecc5759668fd3af379eaddd70b4ae50ecd7f (patch)
tree8b824cc1eb8de6fd15a4b5636f5f62fa95541105 /mutex.c
parent861a8bb5523f257b474f68334c2c5300e52c5371 (diff)
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.
Diffstat (limited to 'mutex.c')
-rw-r--r--mutex.c5
1 files changed, 4 insertions, 1 deletions
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;