diff options
author | kib <kib@FreeBSD.org> | 2016-08-20 12:26:44 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-08-20 12:26:44 +0000 |
commit | 8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1 (patch) | |
tree | d3fb002a2880118eca23542ae9c97773beee2367 /lib/libthr/thread | |
parent | 2e9b1dc197dd198d7379e4a4f79a80cbcf43a1ee (diff) | |
download | FreeBSD-src-8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1.zip FreeBSD-src-8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1.tar.gz |
MFC r303795:
Add __cxa_thread_atexit(3) API implementation.
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_exit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c index 7001311..383aafa 100644 --- a/lib/libthr/thread/thr_exit.c +++ b/lib/libthr/thread/thr_exit.c @@ -151,8 +151,12 @@ thread_unwind_stop(int version, _Unwind_Action actions, __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! */ + } return (_URC_NO_REASON); } @@ -246,6 +250,8 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); + exit_thread(); } @@ -253,6 +259,7 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); exit_thread(); #endif /* _PTHREAD_FORCED_UNWIND */ |