Changeset View
Changeset View
Standalone View
Standalone View
lib/libthr/thread/thr_exit.c
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | if (actions & _UA_END_OF_STACK || | ||||
done = 1; | done = 1; | ||||
} | } | ||||
while ((cur = curthread->cleanup) != NULL && | while ((cur = curthread->cleanup) != NULL && | ||||
(done || (uintptr_t)cur <= cfa)) { | (done || (uintptr_t)cur <= cfa)) { | ||||
__pthread_cleanup_pop_imp(1); | __pthread_cleanup_pop_imp(1); | ||||
} | } | ||||
if (done) | if (done) { | ||||
/* Tell libc that it should call non-trivial TLS dtors. */ | |||||
__cxa_thread_call_dtors(); | |||||
exit_thread(); /* Never return! */ | exit_thread(); /* Never return! */ | ||||
} | |||||
return (_URC_NO_REASON); | return (_URC_NO_REASON); | ||||
} | } | ||||
static void | static void | ||||
thread_unwind(void) | thread_unwind(void) | ||||
{ | { | ||||
struct pthread *curthread = _get_curthread(); | struct pthread *curthread = _get_curthread(); | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
thread_unwind(); | thread_unwind(); | ||||
} else { | } else { | ||||
cleanup: | cleanup: | ||||
while (curthread->cleanup != NULL) { | while (curthread->cleanup != NULL) { | ||||
__pthread_cleanup_pop_imp(1); | __pthread_cleanup_pop_imp(1); | ||||
} | } | ||||
__cxa_thread_call_dtors(); | |||||
exit_thread(); | exit_thread(); | ||||
} | } | ||||
#else | #else | ||||
while (curthread->cleanup != NULL) { | while (curthread->cleanup != NULL) { | ||||
__pthread_cleanup_pop_imp(1); | __pthread_cleanup_pop_imp(1); | ||||
} | } | ||||
__cxa_thread_call_dtors(); | |||||
exit_thread(); | exit_thread(); | ||||
#endif /* _PTHREAD_FORCED_UNWIND */ | #endif /* _PTHREAD_FORCED_UNWIND */ | ||||
} | } | ||||
static void | static void | ||||
exit_thread(void) | exit_thread(void) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |