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.
This commit is contained in:
davidxu 2013-04-18 05:12:11 +00:00
parent 630a792630
commit 05a4fb8c6e

View File

@ -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);
}