Date: Thu, 18 Apr 2013 05:12:11 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249604 - head/lib/libthr/thread Message-ID: <201304180512.r3I5CBBn009227@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Thu Apr 18 05:12:11 2013 New Revision: 249604 URL: http://svnweb.freebsd.org/changeset/base/249604 Log: 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. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Thu Apr 18 02:20:58 2013 (r249603) +++ head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:12:11 2013 (r249604) @@ -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); +}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304180512.r3I5CBBn009227>