summaryrefslogtreecommitdiff
path: root/pthread_delay_np.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-11-03 01:08:41 +0000
committerrpj <rpj>2004-11-03 01:08:41 +0000
commitec8290acdaea21b16d98f1ef5d4ae8a28ab2109a (patch)
tree0bd3750ec1cc12594b6cfe69473e393da6ec101b /pthread_delay_np.c
parentcccaf0c2c82e78a72d69a4a50c872f308bed2f65 (diff)
Mutex, semaphore, thread ID, test suite changes - see ChangeLogs
Diffstat (limited to 'pthread_delay_np.c')
-rw-r--r--pthread_delay_np.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/pthread_delay_np.c b/pthread_delay_np.c
index ee9b2d9..c699a31 100644
--- a/pthread_delay_np.c
+++ b/pthread_delay_np.c
@@ -86,6 +86,7 @@ pthread_delay_np (struct timespec *interval)
DWORD millisecs;
DWORD status;
pthread_t self;
+ ptw32_thread_t * sp;
if (interval == NULL)
{
@@ -124,34 +125,36 @@ pthread_delay_np (struct timespec *interval)
#pragma enable_message (124)
#endif
- if (NULL == (self = pthread_self ()))
+ if (NULL == (self = pthread_self ()).p)
{
return ENOMEM;
}
- if (self->cancelState == PTHREAD_CANCEL_ENABLE)
+ sp = (ptw32_thread_t *) self.p;
+
+ if (sp->cancelState == PTHREAD_CANCEL_ENABLE)
{
/*
* Async cancelation won't catch us until wait_time is up.
* Deferred cancelation will cancel us immediately.
*/
if (WAIT_OBJECT_0 ==
- (status = WaitForSingleObject (self->cancelEvent, wait_time)))
+ (status = WaitForSingleObject (sp->cancelEvent, wait_time)))
{
/*
* Canceling!
*/
- (void) pthread_mutex_lock (&self->cancelLock);
- if (self->state < PThreadStateCanceling)
+ (void) pthread_mutex_lock (&sp->cancelLock);
+ if (sp->state < PThreadStateCanceling)
{
- self->state = PThreadStateCanceling;
- self->cancelState = PTHREAD_CANCEL_DISABLE;
- (void) pthread_mutex_unlock (&self->cancelLock);
+ sp->state = PThreadStateCanceling;
+ sp->cancelState = PTHREAD_CANCEL_DISABLE;
+ (void) pthread_mutex_unlock (&sp->cancelLock);
ptw32_throw (PTW32_EPS_CANCEL);
}
- (void) pthread_mutex_unlock (&self->cancelLock);
+ (void) pthread_mutex_unlock (&sp->cancelLock);
return ESRCH;
}
else if (status != WAIT_TIMEOUT)