summaryrefslogtreecommitdiff
path: root/ptw32_threadDestroy.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 /ptw32_threadDestroy.c
parentcccaf0c2c82e78a72d69a4a50c872f308bed2f65 (diff)
Mutex, semaphore, thread ID, test suite changes - see ChangeLogs
Diffstat (limited to 'ptw32_threadDestroy.c')
-rw-r--r--ptw32_threadDestroy.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ptw32_threadDestroy.c b/ptw32_threadDestroy.c
index 58b23ff..9bca1b4 100644
--- a/ptw32_threadDestroy.c
+++ b/ptw32_threadDestroy.c
@@ -42,20 +42,21 @@
void
ptw32_threadDestroy (pthread_t thread)
{
- struct pthread_t_ threadCopy;
+ ptw32_thread_t * tp = (ptw32_thread_t *) thread.p;
+ ptw32_thread_t threadCopy;
- if (thread != NULL)
+ if (tp != NULL)
{
- (void) pthread_mutex_lock (&thread->cancelLock);
- thread->state = PThreadStateLast;
- (void) pthread_mutex_unlock (&thread->cancelLock);
+ (void) pthread_mutex_lock (&tp->cancelLock);
+ tp->state = PThreadStateLast;
+ (void) pthread_mutex_unlock (&tp->cancelLock);
ptw32_callUserDestroyRoutines (thread);
/*
* Copy thread state so that the thread can be atomically NULLed.
*/
- memcpy (&threadCopy, thread, sizeof (threadCopy));
+ memcpy (&threadCopy, tp, sizeof (threadCopy));
/*
* Thread ID structs are never freed. They're NULLed and reused.