aboutsummaryrefslogtreecommitdiff
path: root/pthreads/w32_CancelableWait.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-18 10:33:05 +0200
committermarha <marha@users.sourceforge.net>2011-07-18 10:33:05 +0200
commit88101146f2ec7d53ffb793e365f05097ffd35fd3 (patch)
treedb77eef572a00c62c8d9485c4786f682e20a2fd0 /pthreads/w32_CancelableWait.c
parent772373ccc8da2b2019555228f4972cc0c5a885a4 (diff)
downloadvcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.gz
vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.bz2
vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.zip
cvs version of pthreads
Diffstat (limited to 'pthreads/w32_CancelableWait.c')
-rw-r--r--pthreads/w32_CancelableWait.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pthreads/w32_CancelableWait.c b/pthreads/w32_CancelableWait.c
index 97e15aa31..070633e0f 100644
--- a/pthreads/w32_CancelableWait.c
+++ b/pthreads/w32_CancelableWait.c
@@ -110,21 +110,22 @@ ptw32_cancelable_wait (HANDLE waitHandle, DWORD timeout)
if (sp != NULL)
{
+ ptw32_mcs_local_node_t stateLock;
/*
* Should handle POSIX and implicit POSIX threads..
* Make sure we haven't been async-canceled in the meantime.
*/
- (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);
/* Never reached */
}
- (void) pthread_mutex_unlock (&sp->cancelLock);
+ ptw32_mcs_lock_release (&stateLock);
}
/* Should never get to here. */