summaryrefslogtreecommitdiff
path: root/pthread_delay_np.c
diff options
context:
space:
mode:
authorrpj <rpj>2011-03-24 23:33:14 +0000
committerrpj <rpj>2011-03-24 23:33:14 +0000
commitdb171f2f9435b98f05f33fcbc0dcf0c5cc1cb917 (patch)
tree9d617a20a9e0ad1fcf415e353057c53e6d77d0f3 /pthread_delay_np.c
parente5229a33f8724a90cbb0b56c3ecc1d6691bf54d7 (diff)
First pass of robust mutexes
Diffstat (limited to 'pthread_delay_np.c')
-rw-r--r--pthread_delay_np.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pthread_delay_np.c b/pthread_delay_np.c
index f624fc8..e6c96d8 100644
--- a/pthread_delay_np.c
+++ b/pthread_delay_np.c
@@ -141,20 +141,21 @@ pthread_delay_np (struct timespec *interval)
if (WAIT_OBJECT_0 ==
(status = WaitForSingleObject (sp->cancelEvent, wait_time)))
{
+ ptw32_mcs_local_node_t stateLock;
/*
* Canceling!
*/
- (void) pthread_mutex_lock (&sp->cancelLock);
+ ptw32_mcs_lock_acquire (&sp->stateLock, &stateLock);
if (sp->state < PThreadStateCanceling)
{
sp->state = PThreadStateCanceling;
sp->cancelState = PTHREAD_CANCEL_DISABLE;
- (void) pthread_mutex_unlock (&sp->cancelLock);
+ ptw32_mcs_lock_release (&stateLock);
ptw32_throw (PTW32_EPS_CANCEL);
}
- (void) pthread_mutex_unlock (&sp->cancelLock);
+ ptw32_mcs_lock_release (&stateLock);
return ESRCH;
}
else if (status != WAIT_TIMEOUT)