Introduce __cxa_thread_atexit()

This commit is contained in:
Justine Tunney 2023-10-31 19:56:55 -07:00
parent a699cda5c8
commit ee82f90bba
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 98 additions and 0 deletions

View file

@ -20,6 +20,7 @@
#include "libc/intrin/asan.internal.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/cmpxchg.h"
#include "libc/intrin/cxaatexit.internal.h"
#include "libc/intrin/kprintf.h"
#include "libc/intrin/strace.internal.h"
#include "libc/mem/mem.h"
@ -94,6 +95,7 @@ dontasan void CheckForMemoryLeaks(void) {
exit(0);
}
_pthread_unwind(_pthread_self());
__cxa_thread_finalize();
_pthread_unkey(__get_tls());
_pthread_ungarbage();
__cxa_finalize(0);