From 0fc0a407596a03886c5bba4c4d98eb520f49c7ba Mon Sep 17 00:00:00 2001 From: Efsane Soyer Date: Wed, 27 Mar 2024 18:35:38 -0700 Subject: [PATCH] Busy wait if the wait time < MIN_SLEEP_DURATION --- core/threaded/reactor_threaded.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/threaded/reactor_threaded.c b/core/threaded/reactor_threaded.c index 62eaef6c2..7d1a34812 100644 --- a/core/threaded/reactor_threaded.c +++ b/core/threaded/reactor_threaded.c @@ -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; }