diff options
author | alex <alex@FreeBSD.org> | 1997-12-25 05:07:20 +0000 |
---|---|---|
committer | alex <alex@FreeBSD.org> | 1997-12-25 05:07:20 +0000 |
commit | 370393763bf73ce9da93cd977f866919de626f2f (patch) | |
tree | ebf81a51f33cfc5ee40812b37eeecd89a145f151 /lib/libkse/thread | |
parent | 32ddc95d9022f09a9b44b5dec56dee6e77bb2914 (diff) | |
download | FreeBSD-src-370393763bf73ce9da93cd977f866919de626f2f.zip FreeBSD-src-370393763bf73ce9da93cd977f866919de626f2f.tar.gz |
Changed pthread_detach to conform to POSIX, i.e. the single argument
provided is of type pthread_t instead of pthread_t *.
PR: 4320
Return EINVAL instead of ESRCH if attempting to detach an already
detached thread.
Diffstat (limited to 'lib/libkse/thread')
-rw-r--r-- | lib/libkse/thread/thr_detach.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libkse/thread/thr_detach.c b/lib/libkse/thread/thr_detach.c index c8f312c..a9f2469 100644 --- a/lib/libkse/thread/thr_detach.c +++ b/lib/libkse/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: */ |