summaryrefslogtreecommitdiff
path: root/libcr/coroutine.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcr/coroutine.c')
-rw-r--r--libcr/coroutine.c20
1 files changed, 10 insertions, 10 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",