diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-29 12:14:45 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-29 12:24:10 -0600 |
commit | cd0b080d638005bff762f1f8cae9a6c76648265b (patch) | |
tree | f9b76002924a16afae66df3815d521f0e7b25efb /libcr | |
parent | 6940b244de7c5048c55fc57ada93501c1be5ab20 (diff) |
tidy, s/sighandler/intrhandler/
Diffstat (limited to 'libcr')
-rw-r--r-- | libcr/coroutine.c | 20 | ||||
-rw-r--r-- | libcr/include/libcr/coroutine.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 25e3e4f..74c74d8 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -131,7 +131,7 @@ enum coroutine_state { struct coroutine { volatile enum coroutine_state state; - volatile bool sig_unpause; + volatile bool intr_unpause; jmp_buf env; size_t stack_size; void *stack; @@ -444,11 +444,11 @@ void cr_yield(void) { void cr_pause_and_yield(void) { assert_cid_state(coroutine_running, == CR_RUNNING); - if (coroutine_table[coroutine_running-1].sig_unpause) + if (coroutine_table[coroutine_running-1].intr_unpause) _cr_transition(CR_RUNNABLE); else _cr_transition(CR_PAUSED); - coroutine_table[coroutine_running-1].sig_unpause = false; + coroutine_table[coroutine_running-1].intr_unpause = false; } void cr_exit(void) { @@ -463,23 +463,23 @@ void cr_unpause(cid_t cid) { assert_cid_state(cid, == CR_PAUSED); debugf("cr_unpause(%zu)\n", cid); - coroutine_table[cid-1].sig_unpause = false; - coroutine_table[cid-1].state = CR_RUNNABLE; + coroutine_table[cid-1].intr_unpause = false; + coroutine_table[cid-1].state = CR_RUNNABLE; } -void cr_unpause_from_sighandler(cid_t cid) { +void cr_unpause_from_intrhandler(cid_t cid) { assert_cid(cid); - debugf("cr_unpause_from_sighandler(%zu)\n", cid); + debugf("cr_unpause_from_intrhandler(%zu)\n", cid); switch (coroutine_table[cid-1].state) { case CR_RUNNING: debugf("... raced, deferring unpause\n"); - coroutine_table[cid-1].sig_unpause = true; + coroutine_table[cid-1].intr_unpause = true; break; case CR_PAUSED: debugf("... actual unpause\n"); - coroutine_table[cid-1].sig_unpause = false; - coroutine_table[cid-1].state = CR_RUNNABLE; + coroutine_table[cid-1].intr_unpause = false; + coroutine_table[cid-1].state = CR_RUNNABLE; break; default: assertf(false, "cid=%zu state=%s\n", diff --git a/libcr/include/libcr/coroutine.h b/libcr/include/libcr/coroutine.h index faaf6c3..f580b09 100644 --- a/libcr/include/libcr/coroutine.h +++ b/libcr/include/libcr/coroutine.h @@ -113,8 +113,8 @@ void cr_yield(void); void cr_pause_and_yield(void); /** cr_unpause() marks a coroutine as runnable that has previously marked itself as non-runnable with cr_pause_and_yield(). */ void cr_unpause(cid_t); -/** cr_unpause_from_sighandler() is like cr_unpause(), but safe to call from a signal handler that might race with the coroutine actually pausing itself. */ -void cr_unpause_from_sighandler(cid_t); +/** cr_unpause_from_intrhandler() is like cr_unpause(), but safe to call from a interrupt handler that might race with the coroutine actually pausing itself. */ +void cr_unpause_from_intrhandler(cid_t); /** cr_end() is a counterpart to cr_begin(), but is really just cr_exit(). */ #define cr_end cr_exit |