From f9081b172cc47f8a0e35cf8bd0f46258bd599a5b Mon Sep 17 00:00:00 2001 From: Byeonggil Jun Date: Wed, 29 Jan 2025 16:30:54 -0700 Subject: [PATCH] Revert changes --- core/threaded/reactor_threaded.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/threaded/reactor_threaded.c b/core/threaded/reactor_threaded.c index 9f6f8cd35..493bd5a3e 100644 --- a/core/threaded/reactor_threaded.c +++ b/core/threaded/reactor_threaded.c @@ -199,6 +199,11 @@ bool wait_until(instant_t wait_until_time, lf_cond_t* condition) { LF_PRINT_DEBUG("-------- Waiting until physical time " PRINTF_TIME, wait_until_time - start_time); // Check whether we actually need to wait, or if we have already passed the timepoint. interval_t wait_duration = wait_until_time - lf_time_physical(); + 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); + return true; + } // We do the sleep on the cond var so we can be awakened by the // asynchronous scheduling of a physical action. lf_clock_cond_timedwait