* 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:
@@ -27,7 +27,7 @@ typedef struct callback_node {
|
|||||||
} callback_node;
|
} callback_node;
|
||||||
|
|
||||||
|
|
||||||
void _thread_do_exit_notification(void);
|
void _thread_do_exit_work(void);
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
@@ -40,14 +40,23 @@ thread_entry(thread_func entry, void* _thread)
|
|||||||
|
|
||||||
returnCode = entry(thread->entry_argument);
|
returnCode = entry(thread->entry_argument);
|
||||||
|
|
||||||
_thread_do_exit_notification();
|
_thread_do_exit_work();
|
||||||
|
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if __GNUC__ < 3
|
||||||
void
|
void
|
||||||
_thread_do_exit_notification(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 *node = tls_get(TLS_ON_EXIT_THREAD_SLOT);
|
||||||
callback_node *next;
|
callback_node *next;
|
||||||
|
|||||||
@@ -54,10 +54,6 @@ __pthread_destroy_thread(void)
|
|||||||
{
|
{
|
||||||
pthread_thread* thread = pthread_self();
|
pthread_thread* thread = pthread_self();
|
||||||
|
|
||||||
// check if the thread is already dead
|
|
||||||
if ((atomic_get(&thread->flags) & THREAD_DEAD) != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// call cleanup handlers
|
// call cleanup handlers
|
||||||
while (true) {
|
while (true) {
|
||||||
struct __pthread_cleanup_handler* handler
|
struct __pthread_cleanup_handler* handler
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
extern void _IO_cleanup(void);
|
extern void _IO_cleanup(void);
|
||||||
extern void _thread_do_exit_notification(void);
|
extern void _thread_do_exit_work(void);
|
||||||
|
|
||||||
struct exit_stack_info {
|
struct exit_stack_info {
|
||||||
void (*exit_stack[ATEXIT_MAX])(void);
|
void (*exit_stack[ATEXIT_MAX])(void);
|
||||||
@@ -127,7 +127,7 @@ void
|
|||||||
exit(int status)
|
exit(int status)
|
||||||
{
|
{
|
||||||
// BeOS on exit notification for the main thread
|
// BeOS on exit notification for the main thread
|
||||||
_thread_do_exit_notification();
|
_thread_do_exit_work();
|
||||||
|
|
||||||
// unwind the exit stack, calling the registered functions
|
// unwind the exit stack, calling the registered functions
|
||||||
_exit_stack_lock();
|
_exit_stack_lock();
|
||||||
|
|||||||
Reference in New Issue
Block a user