diff options
Diffstat (limited to 'lib/libc_r/uthread/uthread_detach.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_detach.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libc_r/uthread/uthread_detach.c b/lib/libc_r/uthread/uthread_detach.c index 57c073a..da456bf 100644 --- a/lib/libc_r/uthread/uthread_detach.c +++ b/lib/libc_r/uthread/uthread_detach.c @@ -42,14 +42,11 @@ pthread_detach(pthread_t pthread) int status; pthread_t next_thread; - /* Block signals: */ - _thread_kern_sig_block(&status); - /* Check for invalid calling parameters: */ - if (pthread == NULL || pthread->magic != PTHREAD_MAGIC) { + if (pthread == NULL || pthread->magic != PTHREAD_MAGIC) /* Return an invalid argument error: */ rval = EINVAL; - } + /* Check if the thread has not been detached: */ else if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) { /* Flag the thread as detached: */ @@ -60,13 +57,9 @@ pthread_detach(pthread_t pthread) /* Make the thread run: */ PTHREAD_NEW_STATE(next_thread,PS_RUNNING); } - } else { + } else /* Return an error: */ rval = EINVAL; - } - - /* Unblock signals: */ - _thread_kern_sig_unblock(status); /* Return the completion status: */ return (rval); |