summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2013-04-18 05:12:11 +0000
committerdavidxu <davidxu@FreeBSD.org>2013-04-18 05:12:11 +0000
commit05a4fb8c6e2d4ef9d563419c0af6b81ab5bfd6c0 (patch)
tree107659e7ca960e3f74c9be96f5a0415189832b9a /lib/libthr
parent630a7926307fcf6760d3c4c9fadc6ac2c8b52f67 (diff)
downloadFreeBSD-src-05a4fb8c6e2d4ef9d563419c0af6b81ab5bfd6c0.zip
FreeBSD-src-05a4fb8c6e2d4ef9d563419c0af6b81ab5bfd6c0.tar.gz
Revert revision 249323, the PR/177624 is confusing, that bug is caused
by using buggy getcontext/setcontext on same stack, while swapcontext normally works on different stack, there is no such a problem.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_sig.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index a99395f..d2be994 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -737,4 +737,13 @@ _setcontext(const ucontext_t *ucp)
return __sys_setcontext(&uc);
}
-__weak_reference(__sys_swapcontext, swapcontext);
+__weak_reference(_swapcontext, swapcontext);
+int
+_swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
+{
+ ucontext_t uc;
+
+ (void) memcpy(&uc, ucp, sizeof(uc));
+ remove_thr_signals(&uc.uc_sigmask);
+ return __sys_swapcontext(oucp, &uc);
+}
OpenPOWER on IntegriCloud