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/atomic.h"
#include "libc/dce.h"
#include "libc/intrin/atomic.h"
#include "libc/intrin/cxaatexit.internal.h"
#include "libc/intrin/strace.internal.h"
#include "libc/intrin/weaken.h"
#include "libc/limits.h"
@ -110,6 +111,9 @@ wontreturn void pthread_exit(void *rc) {
// free resources
_pthread_unwind(pt);
if (_weaken(__cxa_thread_finalize)) {
_weaken(__cxa_thread_finalize)();
}
_pthread_unkey(tib);
_pthread_ungarbage();
_pthread_decimate();