summaryrefslogtreecommitdiff
path: root/pthread_detach.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread_detach.c')
-rw-r--r--pthread_detach.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pthread_detach.c b/pthread_detach.c
index a376cf2..df2c542 100644
--- a/pthread_detach.c
+++ b/pthread_detach.c
@@ -75,6 +75,7 @@ pthread_detach (pthread_t thread)
*/
{
int result;
+ ptw32_thread_t * tp = (ptw32_thread_t *) thread.p;
/* This is the proper way to test for a valid thread. */
result = pthread_kill (thread, 0);
@@ -83,14 +84,14 @@ pthread_detach (pthread_t thread)
return result;
}
- if (thread->detachState == PTHREAD_CREATE_DETACHED)
+ if (tp->detachState == PTHREAD_CREATE_DETACHED)
{
result = EINVAL;
}
else
{
result = 0;
- thread->detachState = PTHREAD_CREATE_DETACHED;
+ tp->detachState = PTHREAD_CREATE_DETACHED;
}
return (result);