@@ -53,32 +53,33 @@ struct Waiter;
53
53
* - Acquire a lock on the mutex used to construct the condition variable.
54
54
* - Execute `notify_one` or `notify_all` on the condition variable.
55
55
*
56
- * #### Defined behavior
57
- * - All threads waiting on the condition variable wake when
56
+ * All threads waiting on the condition variable wake when
58
57
* `ConditionVariable::notify_all` is called.
59
- * - At least one thread waiting on the condition variable wakes
58
+ * At least one thread waiting on the condition variable wakes
60
59
* when `ConditionVariable::notify_one` is called.
61
- * - While a thread is waiting for notification of a
62
- * ConditionVariable, it releases the lock held on the mutex.
63
- * - The ConditionVariable reacquires the mutex lock before exiting the wait
60
+ *
61
+ * While a thread is waiting for notification of a
62
+ * ConditionVariable, it releases the lock held on the mutex.
63
+ * The ConditionVariable reacquires the mutex lock before exiting the wait
64
64
* function.
65
65
*
66
- * #### Undefined behavior
66
+ * #### Unspecified behavior
67
67
* - The thread that is unblocked on `ConditionVariable::notify_one` is
68
- * undefined if there are multiple waiters.
68
+ * unspecified if there are multiple waiters.
69
+ * - When `ConditionVariable::notify_one` or `ConditionVariable::notify_all` is
70
+ * called and there are one or more waiters, and one or more threads
71
+ * attempting to acquire the condition variable's mutex, the order in which the mutex is
72
+ * acquired is unspecified.
73
+ * - Spurious notifications (not triggered by the application) can occur.
74
+ *
75
+ * #### Undefined behavior
69
76
* - Calling wait if the mutex is not locked by the current thread is undefined
70
77
* behavior.
71
78
* - The order in which waiting threads acquire the condition variable's
72
79
* mutex after `ConditionVariable::notify_all` is called is undefined.
73
- * - When `ConditionVariable::notify_one` or `ConditionVariable::notify_all` is
74
- * called and there are one or more waiters, and one or more threads
75
- * attempting to acquire the condition variable's mutex, the order in which the mutex is
76
- * acquired is undefined.
77
80
* - The behavior of `ConditionVariable::wait` and `ConditionVariable::wait_for`
78
81
* is undefined if the condition variable's mutex is locked more than once by
79
82
* the calling thread.
80
- * - Spurious notifications (not triggered by the application) can occur,
81
- * and it is not defined when these occur.
82
83
*
83
84
* @note Synchronization level: Thread safe
84
85
*
0 commit comments