]> Kevux Git Server - fll/commitdiff
Update: Add additional documentation notes regarding threaded conditional waits.
authorKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 20:35:26 +0000 (15:35 -0500)
committerKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 20:35:26 +0000 (15:35 -0500)
Make it easier to remember that the mutex must be locked before and unlocked after by the caller of the function.

level_0/f_thread/c/thread.h

index 0474cbbd58152d2a1e7e94c34c290934b7114295..bb007e743f65ee495c4eb088f8bdd9146b55c449 100644 (file)
@@ -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.