diff options
| author | Alexander Langer <alex@FreeBSD.org> | 1997-12-25 05:07:20 +0000 |
|---|---|---|
| committer | Alexander Langer <alex@FreeBSD.org> | 1997-12-25 05:07:20 +0000 |
| commit | 372787c1024cb186e9a8984aea36fdc63114f11b (patch) | |
| tree | 07718e1eea9d2ffe5551126880e9316a166eb75d /lib/libpthread/thread/thr_detach.c | |
| parent | 3b7c07b1f24e9d74d985cbe19e405c5a0295ac68 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_detach.c')
| -rw-r--r-- | lib/libpthread/thread/thr_detach.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c index c8f312c925c2..a9f24699e3c6 100644 --- a/lib/libpthread/thread/thr_detach.c +++ b/lib/libpthread/thread/thr_detach.c @@ -36,18 +36,17 @@ #include "pthread_private.h" int -pthread_detach(pthread_t * p_pthread) +pthread_detach(pthread_t pthread) { int rval = 0; int status; pthread_t next_thread; - pthread_t pthread; /* Block signals: */ _thread_kern_sig_block(&status); /* Check for invalid calling parameters: */ - if (p_pthread == NULL || (pthread = *p_pthread) == NULL) { + if (pthread == NULL) { /* Return an invalid argument error: */ rval = EINVAL; } @@ -61,15 +60,9 @@ pthread_detach(pthread_t * p_pthread) /* Make the thread run: */ PTHREAD_NEW_STATE(next_thread,PS_RUNNING); } - - /* - * NULL the thread pointer now that the thread has been - * detached: - */ - *p_pthread = NULL; } else { /* Return an error: */ - rval = ESRCH; + rval = EINVAL; } /* Unblock signals: */ |
