Title: | DECthreads Conference |
Moderator: | PTHRED::MARYS TE ON |
Created: | Mon May 14 1990 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1553 |
Total number of notes: | 9541 |
I've got a quick question about pthread_detach. I noticed in the debugger that when pthread_detach completes it zeroes out the thread id that was passed into it. The documentation suggests that the input to the call is read only. Is this expected behaviour? I've seen this happen on Digital unix 3.2G and AlphaVMS V6.2. The posix 1003.4a (draft 4) interface is being used. thanks Rich
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1504.1 | DCETHD::BUTENHOF | Dave Butenhof, DECthreads | Wed Mar 12 1997 08:18 | 9 | |
Yes, it is expected (and intentional) behavior. The standard was specifically written to allow it. The idea is that the handle can no longer be used, and should be cleared to make later validation easier. (Note that POSIX threads pthread_detach(), and pthread_join() -- which also detaches the target thread -- take the pthread_t by value rather than by reference, and cannot clear the handle.) /dave | |||||
1504.2 | For those of you reading lightly. | WTFN::SCALES | Despair is appropriate and inevitable. | Wed Mar 12 1997 12:11 | 8 |
.1> Note that POSIX threads pthread_detach(), and pthread_join() In case it's not perfectly clear to the rest of you, Dave is using "POSIX" here to refer to the (now standard) .1c pthread interface; whereas, Rich is using the old .4a draft interface. Webb |