Skip to content

Commit cecd96f

Browse files
Mel WCruz Monrreal II
authored andcommitted
Breaking behaviors into two sections
as per @kjbracey-arm review
1 parent 99cc7f2 commit cecd96f

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

rtos/ConditionVariable.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,33 @@ struct Waiter;
5353
* - Acquire a lock on the mutex used to construct the condition variable.
5454
* - Execute `notify_one` or `notify_all` on the condition variable.
5555
*
56-
* #### Defined behavior
57-
* - All threads waiting on the condition variable wake when
56+
* All threads waiting on the condition variable wake when
5857
* `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
6059
* 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
6464
* function.
6565
*
66-
* #### Undefined behavior
66+
* #### Unspecified behavior
6767
* - 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
6976
* - Calling wait if the mutex is not locked by the current thread is undefined
7077
* behavior.
7178
* - The order in which waiting threads acquire the condition variable's
7279
* 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.
7780
* - The behavior of `ConditionVariable::wait` and `ConditionVariable::wait_for`
7881
* is undefined if the condition variable's mutex is locked more than once by
7982
* the calling thread.
80-
* - Spurious notifications (not triggered by the application) can occur,
81-
* and it is not defined when these occur.
8283
*
8384
* @note Synchronization level: Thread safe
8485
*

0 commit comments

Comments
 (0)