From: Ulrich Drepper Date: Wed, 10 Nov 1999 05:03:07 +0000 (+0000) Subject: (pthread_exit): Set __pthread_last_event. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7487e1347fd950daad8c68b029f7b084a53b1e6d;p=thirdparty%2Fglibc.git (pthread_exit): Set __pthread_last_event. (pthread_exit): Signal event if this is wanted. --- diff --git a/linuxthreads/join.c b/linuxthreads/join.c index 42eb033746f..71db541391b 100644 --- a/linuxthreads/join.c +++ b/linuxthreads/join.c @@ -39,6 +39,27 @@ void pthread_exit(void * retval) THREAD_SETMEM(self, p_retval, retval); /* Say that we've terminated */ THREAD_SETMEM(self, p_terminated, 1); + /* See whether we have to signal the death. */ + if (THREAD_GETMEM(self, p_report_events)) + { + /* See whether TD_DEATH is in any of the mask. */ + int idx = __td_eventword (TD_DEATH); + uint32_t mask = __td_eventmask (TD_DEATH); + + if ((mask & (__pthread_threads_events.event_bits[idx] + | THREAD_GETMEM(self, + p_eventbuf.eventmask).event_bits[idx])) + != 0) + { + /* Yep, we have to signal the death. */ + THREAD_SETMEM(self, p_eventbuf.eventnum, TD_DEATH); + THREAD_SETMEM(self, p_eventbuf.eventdata, self); + __pthread_last_event = self; + + /* Now call the function to signal the event. */ + __linuxthreads_death_event(); + } + } /* See if someone is joining on us */ joining = THREAD_GETMEM(self, p_joining); __pthread_unlock(THREAD_GETMEM(self, p_lock));