mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38:30 +00:00
Implement raise() with getcontext() / setcontext()
This commit is contained in:
parent
dd83db9567
commit
736fdb757a
12 changed files with 73 additions and 97 deletions
|
@ -24,8 +24,6 @@
|
|||
int __tailcontext(const ucontext_t *);
|
||||
|
||||
static int __contextmask(const sigset_t *opt_set, sigset_t *opt_out_oldset) {
|
||||
if (!__interruptible) return 0;
|
||||
// signal handling functions might exist
|
||||
// now context switching needs to go 14x slower
|
||||
return sigprocmask(SIG_SETMASK, opt_set, opt_out_oldset);
|
||||
}
|
||||
|
@ -33,12 +31,6 @@ static int __contextmask(const sigset_t *opt_set, sigset_t *opt_out_oldset) {
|
|||
/**
|
||||
* Sets machine context.
|
||||
*
|
||||
* This function goes 14x slower if sigaction() has ever been used to
|
||||
* install a signal handling function. If you don't care about signal
|
||||
* safety and just want fast fibers, then you may override the global
|
||||
* variable `__interruptible` to disable the sigprocmask() calls, for
|
||||
* pure userspace context switching.
|
||||
*
|
||||
* @return -1 on error w/ errno, otherwise won't return unless sent back
|
||||
* @see swapcontext()
|
||||
* @see makecontext()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue