Skip to content

Commit

Permalink
Busy wait if the wait time < MIN_SLEEP_DURATION
Browse files Browse the repository at this point in the history
  • Loading branch information
soyerefsane committed Mar 28, 2024
1 parent 22d49a1 commit 0fc0a40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/threaded/reactor_threaded.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ bool wait_until(instant_t logical_time, lf_cond_t* condition) {
if (wait_duration < MIN_SLEEP_DURATION) {
LF_PRINT_DEBUG("Wait time " PRINTF_TIME " is less than MIN_SLEEP_DURATION " PRINTF_TIME ". Skipping wait.",
wait_duration, MIN_SLEEP_DURATION);
while (lf_time_physical() < wait_until_time) {
//Busy wait
}
return true;
}

Expand Down

0 comments on commit 0fc0a40

Please sign in to comment.