summaryrefslogtreecommitdiff
path: root/pthread/pt-setcancelstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread/pt-setcancelstate.c')
-rw-r--r--pthread/pt-setcancelstate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pthread/pt-setcancelstate.c b/pthread/pt-setcancelstate.c
index 38550ee..7b60015 100644
--- a/pthread/pt-setcancelstate.c
+++ b/pthread/pt-setcancelstate.c
@@ -35,9 +35,11 @@ __pthread_setcancelstate (int state, int *oldstate)
break;
}
+ __pthread_mutex_lock (&p->cancel_lock);
if (oldstate)
*oldstate = p->cancel_state;
p->cancel_state = state;
+ __pthread_mutex_unlock (&p->cancel_lock);
return 0;
}