summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/_pthread_stubs.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-25 01:57:47 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-25 01:57:47 +0000
commit74604ed9c419ab380cacaaeb78e4c26f9f37e0ad (patch)
tree7b4cd520f700d5e2d7a21bc8175c8574d209a3ce /lib/libc/gen/_pthread_stubs.c
parentdf0d735bfefbd56b7c7cbca4590c651f83e3c831 (diff)
downloadFreeBSD-src-74604ed9c419ab380cacaaeb78e4c26f9f37e0ad.zip
FreeBSD-src-74604ed9c419ab380cacaaeb78e4c26f9f37e0ad.tar.gz
To support stack unwinding for cancellation points, add -fexceptions flag
for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellation point, it also makes it possible that other functions can be cancellation points in libraries without having to be rewritten in libthr.
Diffstat (limited to 'lib/libc/gen/_pthread_stubs.c')
-rw-r--r--lib/libc/gen/_pthread_stubs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c
index 044e299e..355b904 100644
--- a/lib/libc/gen/_pthread_stubs.c
+++ b/lib/libc/gen/_pthread_stubs.c
@@ -121,6 +121,8 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = {
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_TESTCANCEL */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP_IMP */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH_IMP */
+ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_ENTER */
+ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_LEAVE */
};
/*
@@ -269,6 +271,8 @@ STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *)
STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void)
STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int)
STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *);
+STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int)
+STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int)
static int
stub_zero(void)
OpenPOWER on IntegriCloud