mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-04 13:41:02 +00:00
Call thread finalizers on exit()
While we don't call POSIX thread key destructors from exit(), we do need to call these, since C++ uses it for TLS object destructors. See #1076
This commit is contained in:
parent
07db3004d6
commit
81ce2e4cbc
5 changed files with 56 additions and 22 deletions
|
@ -73,13 +73,6 @@ void OnMainThreadExit(void *arg) {
|
|||
_Exit((long)arg);
|
||||
}
|
||||
|
||||
TEST(__cxa_thread_atexit, exit_wontInvokeThreadDestructors) {
|
||||
SPAWN(fork);
|
||||
__cxa_thread_atexit(OnMainThreadExit, (void *)123L, 0);
|
||||
exit(0);
|
||||
EXITS(0);
|
||||
}
|
||||
|
||||
TEST(__cxa_thread_atexit, pthread_exit_willInvokeThreadDestructors) {
|
||||
SPAWN(fork);
|
||||
__cxa_thread_atexit(OnMainThreadExit, (void *)123L, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue