diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-15 20:33:41 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-19 20:15:27 -0700 |
commit | 1dd3b34b9117d4686a131047afc381ba15b8aac3 (patch) | |
tree | b6d57da9c248a3f9c78a6d2573cafbc65b59ec04 /libcr | |
parent | 936fd0145896acbf55de496f036af55a01b80e82 (diff) |
libcr: Use SIG_SETMASK instead of SIG_(UN)BLOCK
Diffstat (limited to 'libcr')
-rw-r--r-- | libcr/coroutine.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 205d0bb..7f61e94 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -161,15 +161,17 @@ static inline void cr_plat_wait_for_interrupt(void) { pause(); } + /* For a signal to be *in* the mask means that the signal is + * *blocked*. */ void _cr_plat_disable_interrupts(void) { sigset_t all; sigfillset(&all); - sigprocmask(SIG_BLOCK, &all, NULL); + sigprocmask(SIG_SETMASK, &all, NULL); } void _cr_plat_enable_interrupts(void) { - sigset_t all; - sigfillset(&all); - sigprocmask(SIG_UNBLOCK, &all, NULL); + sigset_t zero; + sigemptyset(&zero); + sigprocmask(SIG_SETMASK, &zero, NULL); } #elif __arm__ /* Assume bare-metal if !__unix__. */ |