From 78ecbc3c3e1a08a9e8fd35983dc0b22c8e2d116e Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 3 Jun 2005 14:49:22 +0000 Subject: '' --- pthread_once.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pthread_once.c') diff --git a/pthread_once.c b/pthread_once.c index efcfd0f..572943f 100644 --- a/pthread_once.c +++ b/pthread_once.c @@ -54,13 +54,13 @@ pthread_once (pthread_once_t * once_control, void (*init_routine) (void)) return EINVAL; } - if (InterlockedExchangeAdd((LPLONG)&once_control->done, 0L)) /* MBR fence */ + if (InterlockedExchangeAdd((LPLONG)&once_control->init, 0L)) /* MBR fence */ { ptw32_mcs_local_node_t node; ptw32_mcs_lock_acquire((ptw32_mcs_lock_t *)&once_control->lock, &node); - if (InterlockedExchangeAdd((LPLONG)&once_control->done, 0L)) + if (once_control->init) { #ifdef _MSC_VER @@ -75,7 +75,7 @@ pthread_once (pthread_once_t * once_control, void (*init_routine) (void)) #pragma inline_depth() #endif - (void) PTW32_INTERLOCKED_EXCHANGE((LPLONG)&once_control->done, 0L); + once_control->init = 0; } ptw32_mcs_lock_release(&node); -- cgit v1.2.3