1
- /* mbed Microcontroller Library
2
- * Copyright (c) 2017-2017 ARM Limited
1
+ /* Mbed Microcontroller Library
2
+ * Copyright (c) 2017-2018 ARM Limited
3
3
*
4
4
* Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
* of this software and associated documentation files (the "Software"), to deal
@@ -38,32 +38,32 @@ struct Waiter;
38
38
/* * The ConditionVariable class is a synchronization primitive that allows
39
39
* threads to wait until a particular condition occurs.
40
40
*
41
- * The condition variable is used in conjunction with a mutex to safely wait for
41
+ * Use the condition variable in conjunction with a mutex to safely wait for
42
42
* or notify waiters of condition changes to a resource accessible by multiple
43
43
* threads.
44
44
*
45
45
* The thread that intends to wait on a ConditionVariable must:
46
46
* - Acquire a lock on a mutex
47
47
* - Execute `wait`, `wait_for` or `wait_until`. While the thread is waiting,
48
- * the mutex will be unlocked.
48
+ * the mutex is unlocked.
49
49
* - When the condition variable has been notified, or in the case of `wait_for`
50
50
* and `wait_until` the timeout expires, the thread is awakened.
51
51
*
52
52
* The thread that intends to notify a ConditionVariable must:
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 that are waiting on the condition variable will wake when
58
- * ConditionVariable::notify_all is called.
59
- * - At least one thread that is waiting on the condition variable will wake
60
- * when ConditionVariable::notify_one is called.
56
+ * ### Defined behavior
57
+ * - All threads waiting on the condition variable wake when
58
+ * ` ConditionVariable::notify_all` is called.
59
+ * - At least one thread waiting on the condition variable wakes
60
+ * when ` ConditionVariable::notify_one` is called.
61
61
* - While a thread is waiting for notification of a
62
- * ConditionVariable, it will release the lock held on the mutex.
63
- * - The ConditionVariable will reacquire the mutex lock before exiting the wait
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
+ * ### Undefined behavior
67
67
* - The thread that is unblocked on ConditionVariable::notify_one is
68
68
* undefined if there are multiple waiters.
69
69
* - Calling wait if the mutex is not locked by the current thread is undefined
@@ -167,8 +167,8 @@ class ConditionVariable : private mbed::NonCopyable<ConditionVariable> {
167
167
* @note - Spurious notifications can occur, so the caller of this API
168
168
* should check to make sure the condition the caller is waiting on has
169
169
* been met.
170
- *
171
- * @note - The current thread will release the lock while inside the wait
170
+ *
171
+ * @note - The current thread releases the lock while inside the wait
172
172
* function and reacquire it upon exiting the function.
173
173
*
174
174
* Example:
@@ -204,7 +204,7 @@ class ConditionVariable : private mbed::NonCopyable<ConditionVariable> {
204
204
* should check to make sure the condition the caller is waiting on has
205
205
* been met.
206
206
*
207
- * @note - The current thread will release the lock while inside the wait
207
+ * @note - The current thread releases the lock while inside the wait
208
208
* function and reacquire it upon exiting the function.
209
209
*
210
210
* Example:
@@ -245,7 +245,7 @@ class ConditionVariable : private mbed::NonCopyable<ConditionVariable> {
245
245
* should check to make sure the condition the caller is waiting on has
246
246
* been met.
247
247
*
248
- * @note - The current thread will release the lock while inside the wait
248
+ * @note - The current thread releases the lock while inside the wait
249
249
* function and reacquire it upon exiting the function.
250
250
*
251
251
* Example:
@@ -272,7 +272,7 @@ class ConditionVariable : private mbed::NonCopyable<ConditionVariable> {
272
272
273
273
/* * Notify one waiter on this condition variable that a condition changed.
274
274
*
275
- * This function will unblock one of the threads waiting for the condition
275
+ * This function unblocks one of the threads waiting for the condition
276
276
* variable.
277
277
*
278
278
* @note - The thread calling this function must be the owner of the
@@ -287,7 +287,7 @@ class ConditionVariable : private mbed::NonCopyable<ConditionVariable> {
287
287
288
288
/* * Notify all waiters on this condition variable that a condition changed.
289
289
*
290
- * This function will unblock all of the threads waiting for the condition
290
+ * This function unblocks all of the threads waiting for the condition
291
291
* variable.
292
292
*
293
293
* @note - The thread calling this function must be the owner of the
0 commit comments