Skip to content

Commit

Permalink
add manual leave calls to JL_TRY
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jun 7, 2024
1 parent ff412d5 commit 8dc6c95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q,
if (set_not_sleeping(ptls)) {
JL_PROBE_RT_SLEEP_CHECK_TASK_WAKE(ptls);
}
jl_eh_restore_state_noexcept(__eh_ct, &__eh); // leave
if (task)
return task;
continue;
Expand All @@ -473,6 +474,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q,
if (set_not_sleeping(ptls)) {
JL_PROBE_RT_SLEEP_CHECK_TASK_WAKE(ptls);
}
jl_eh_restore_state_noexcept(__eh_ct, &__eh); // leave
return task;
}

Expand Down Expand Up @@ -533,6 +535,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q,
JL_PROBE_RT_SLEEP_CHECK_UV_WAKE(ptls);
}
start_cycles = 0;
jl_eh_restore_state_noexcept(__eh_ct, &__eh); // leave
continue;
}
if (!enter_eventloop && !jl_atomic_load_relaxed(&_threadedregion) && ptls->tid == jl_atomic_load_relaxed(&io_loop_tid)) {
Expand All @@ -542,6 +545,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q,
JL_PROBE_RT_SLEEP_CHECK_UV_WAKE(ptls);
}
start_cycles = 0;
jl_eh_restore_state_noexcept(__eh_ct, &__eh); // leave
continue;
}
}
Expand Down Expand Up @@ -596,6 +600,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q,
if (task) {
assert(task == wait_empty);
wait_empty = NULL;
jl_eh_restore_state_noexcept(__eh_ct, &__eh); // leave
return task;
}
}
Expand Down

0 comments on commit 8dc6c95

Please sign in to comment.