From: Kevin Day Date: Sat, 2 Aug 2025 20:35:26 +0000 (-0500) Subject: Update: Add additional documentation notes regarding threaded conditional waits. X-Git-Tag: 0.7.3~36 X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=c969e634cc191dd1b1f2a362397d5daa02532b7e;p=fll Update: Add additional documentation notes regarding threaded conditional waits. Make it easier to remember that the mutex must be locked before and unlocked after by the caller of the function. --- diff --git a/level_0/f_thread/c/thread.h b/level_0/f_thread/c/thread.h index 0474cbb..bb007e7 100644 --- a/level_0/f_thread/c/thread.h +++ b/level_0/f_thread/c/thread.h @@ -1183,6 +1183,9 @@ extern "C" { * * This is a blocking operation. * + * The caller must lock the mutex before calling this. + * The caller should unlock the mutex after calling this. + * * @param condition * The condition to wait on. * @param mutex @@ -1210,6 +1213,9 @@ extern "C" { * This is a semi-blocking operation. * This blocks until timeout and then no longer block. * + * The caller must lock the mutex before calling this. + * The caller should unlock the mutex after calling this. + * * @param wait * The amount of time to wait for. * The wait time is relative to the clock, so consider calling clock_gettime() or gettimeofday() and then adding the amount of wait time.