File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,15 @@ class CallbackNotifier {
20
20
* @brief Construct a thread-safe notification object
21
21
*
22
22
* Construct a thread-safe notification object which can signal
23
- * release of some shared state with `set()` while other threads
24
- * block on `wait()` until the shared state is released.
23
+ * release of some shared state with `set()` while a single thread
24
+ * blocks on `wait()` until the shared state is released.
25
25
*
26
26
* If libc is glibc and the version is older than 2.25, the
27
27
* implementation uses a spinlock otherwise it uses a condition
28
28
* variable.
29
29
*
30
30
* When C++-20 is the minimum supported version, it should use
31
- * atomic.wait + notify_all .
31
+ * atomic.wait + notify_one .
32
32
*/
33
33
CallbackNotifier () : _flag{false } {};
34
34
@@ -42,8 +42,8 @@ class CallbackNotifier {
42
42
/* *
43
43
* @brief Notify waiting threads that we are done and they can proceed
44
44
*
45
- * Set the flag to true and notify others threads blocked by a call to `wait()`.
46
- * See also `std::condition_variable::notify_all `.
45
+ * Set the flag to true and notify a single thread blocked by a call to `wait()`.
46
+ * See also `std::condition_variable::notify_one `.
47
47
*/
48
48
void set ();
49
49
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ void CallbackNotifier::set()
46
46
// ordering.
47
47
_flag.store (true , std::memory_order_relaxed);
48
48
}
49
- _conditionVariable.notify_all ();
49
+ _conditionVariable.notify_one ();
50
50
}
51
51
}
52
52
You can’t perform that action at this time.
0 commit comments