summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_exit.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-25 10:41:37 -0300
committerRenato Botelho <renato@netgate.com>2016-08-25 10:41:37 -0300
commit29ebd1247162a77db08e5e2e00d033220ec807fe (patch)
treed45bd4c2da327a132f18b6f39db36fe188c4e029 /lib/libthr/thread/thr_exit.c
parent75cd8d40056c799f03b759475d9bfd10ba266a6c (diff)
parentc29dc2b4296960868edafe94ebf975be284200bb (diff)
downloadFreeBSD-src-29ebd1247162a77db08e5e2e00d033220ec807fe.zip
FreeBSD-src-29ebd1247162a77db08e5e2e00d033220ec807fe.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libthr/thread/thr_exit.c')
-rw-r--r--lib/libthr/thread/thr_exit.c9
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 */
OpenPOWER on IntegriCloud