From: Kevin Day Date: Thu, 6 Nov 2025 05:57:46 +0000 (-0600) Subject: Update: Have thread condition wait functions return F_condition on success. X-Git-Tag: 0.7.3~6 X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=9667f29523eb359d088076acceda0f2c391d74eb;p=fll Update: Have thread condition wait functions return F_condition on success. This provides a more accurate status code. --- diff --git a/level_0/f_thread/c/thread/condition.c b/level_0/f_thread/c/thread/condition.c index 561d4a5..7424078 100644 --- a/level_0/f_thread/c/thread/condition.c +++ b/level_0/f_thread/c/thread/condition.c @@ -98,7 +98,7 @@ extern "C" { return F_status_set_error(F_failure); } - return F_okay; + return F_condition; } #endif // _di_f_thread_condition_wait_ @@ -121,7 +121,7 @@ extern "C" { return F_status_set_error(F_failure); } - return F_okay; + return F_condition; } #endif // _di_f_thread_condition_wait_timed_ diff --git a/level_0/f_thread/c/thread/condition.h b/level_0/f_thread/c/thread/condition.h index bf26582..97dd288 100644 --- a/level_0/f_thread/c/thread/condition.h +++ b/level_0/f_thread/c/thread/condition.h @@ -131,7 +131,7 @@ extern "C" { * The mutex to use for waiting on condition. * * @return - * F_okay on success. + * F_condition on success (condition is triggered). * * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead). * F_parameter (with error bit) if a parameter is invalid. @@ -168,7 +168,7 @@ extern "C" { * Must not be NULL. * * @return - * F_okay on success. + * F_condition on success (condition is triggered). * F_time on success, and wait timeout was reached before condition was triggered. * * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead). diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_wait.c b/level_0/f_thread/tests/unit/c/test-thread-condition_wait.c index 57554e4..5cb36d0 100644 --- a/level_0/f_thread/tests/unit/c/test-thread-condition_wait.c +++ b/level_0/f_thread/tests/unit/c/test-thread-condition_wait.c @@ -71,7 +71,7 @@ void test__f_thread_condition_wait__works(void **state) { const f_status_t status = f_thread_condition_wait(&condition, &mutex); - assert_int_equal(status, F_okay); + assert_int_equal(status, F_condition); } } diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_wait_timed.c b/level_0/f_thread/tests/unit/c/test-thread-condition_wait_timed.c index 29592f4..9c7d992 100644 --- a/level_0/f_thread/tests/unit/c/test-thread-condition_wait_timed.c +++ b/level_0/f_thread/tests/unit/c/test-thread-condition_wait_timed.c @@ -82,7 +82,7 @@ void test__f_thread_condition_wait_timed__works(void **state) { const f_status_t status = f_thread_condition_wait_timed(&wait, &condition, &mutex); - assert_int_equal(status, F_okay); + assert_int_equal(status, F_condition); } }