We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Notify
1 parent 0624ff3 commit 850facaCopy full SHA for 850faca
src/sync/notify.rs
@@ -7,6 +7,7 @@ use std::sync::atomic::Ordering::SeqCst;
7
/// primitives.
8
///
9
/// Notification establishes an acquire / release synchronization point.
10
+/// Only one thread may wait on each `Notify` at a time.
11
12
/// Using this type is useful to mock out constructs when using loom tests.
13
#[derive(Debug)]
@@ -26,13 +27,16 @@ impl Notify {
26
27
}
28
29
- /// Notify the waiter
30
+ /// Notify the waiter.
31
#[track_caller]
32
pub fn notify(&self) {
33
self.object.notify(location!());
34
35
- /// Wait for a notification
36
+ /// Wait for a notification.
37
+ ///
38
+ /// # Panics
39
+ /// Panics if multiple threads try to wait on the same `Notify` simultaneously.
40
41
pub fn wait(&self) {
42
self.waiting
0 commit comments