diff options
Diffstat (limited to 'nptl/pthread_getattr_np.c')
-rw-r--r-- | nptl/pthread_getattr_np.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c index 87cf56482f..f6cd8899d8 100644 --- a/nptl/pthread_getattr_np.c +++ b/nptl/pthread_getattr_np.c @@ -39,6 +39,10 @@ pthread_getattr_np (thread_id, attr) struct pthread_attr *iattr = (struct pthread_attr *) attr; int ret = 0; + /* We have to handle cancellation in the following code since we are + locking another threads desriptor. */ + pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &thread->lock); + lll_lock (thread->lock); /* The thread library is responsible for keeping the values in the @@ -175,5 +179,7 @@ pthread_getattr_np (thread_id, attr) lll_unlock (thread->lock); + pthread_cleanup_pop (0); + return ret; } |