* Rename _thread_do_exit_notification() to _thread_do_exit_work() as suggested by Ingo.
Also added an empty stub for _thread_do_exit_notification() when compiling for GCC2. * Removed the check testing if the thread is already dead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35142 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
16940ab877
commit
a4248cf53b
|
@ -27,7 +27,7 @@ typedef struct callback_node {
|
|||
} callback_node;
|
||||
|
||||
|
||||
void _thread_do_exit_notification(void);
|
||||
void _thread_do_exit_work(void);
|
||||
|
||||
|
||||
static status_t
|
||||
|
@ -40,14 +40,23 @@ thread_entry(thread_func entry, void* _thread)
|
|||
|
||||
returnCode = entry(thread->entry_argument);
|
||||
|
||||
_thread_do_exit_notification();
|
||||
_thread_do_exit_work();
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
|
||||
#if __GNUC__ < 3
|
||||
void
|
||||
_thread_do_exit_notification(void)
|
||||
{
|
||||
// empty stub for R5 compability
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
_thread_do_exit_work(void)
|
||||
{
|
||||
callback_node *node = tls_get(TLS_ON_EXIT_THREAD_SLOT);
|
||||
callback_node *next;
|
||||
|
|
|
@ -54,10 +54,6 @@ __pthread_destroy_thread(void)
|
|||
{
|
||||
pthread_thread* thread = pthread_self();
|
||||
|
||||
// check if the thread is already dead
|
||||
if ((atomic_get(&thread->flags) & THREAD_DEAD) != 0)
|
||||
return;
|
||||
|
||||
// call cleanup handlers
|
||||
while (true) {
|
||||
struct __pthread_cleanup_handler* handler
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
extern void _IO_cleanup(void);
|
||||
extern void _thread_do_exit_notification(void);
|
||||
extern void _thread_do_exit_work(void);
|
||||
|
||||
struct exit_stack_info {
|
||||
void (*exit_stack[ATEXIT_MAX])(void);
|
||||
|
@ -127,7 +127,7 @@ void
|
|||
exit(int status)
|
||||
{
|
||||
// BeOS on exit notification for the main thread
|
||||
_thread_do_exit_notification();
|
||||
_thread_do_exit_work();
|
||||
|
||||
// unwind the exit stack, calling the registered functions
|
||||
_exit_stack_lock();
|
||||
|
|
Loading…
Reference in New Issue