MCPcopy Create free account
hub / github.com/NthTensor/Forte / wait

Method wait

src/latch.rs:95–111  ·  view source on GitHub ↗
(&self, seat_bitmask: u32, waiting_bitmask: &'static AtomicU32)

Source from the content-addressed store, hash-verified

93 match self.state.load(Ordering::Acquire) {
94 SIGNAL => Status::Ok,
95 ERROR => Status::Error,
96 _ => Status::Pending,
97 }
98 }
99
100 /// Checks if the latch has been set, and if not waits for a signal on the
101 /// semaphore. This does _not_ wait for the latch to actually become set,
102 /// and may return early. The caller should always re-check the latch
103 /// condition after this returns.
104 ///
105 /// # Memory Ordering
106 ///
107 /// A call to `wait` does not synchronize memory, and so must be used in
108 /// conjunction with `check` (see the type-level "Memory Ordering" section).
109 #[cold]
110 pub fn wait(&self, seat_bitmask: u32, waiting_bitmask: &'static AtomicU32) {
111 // First, check if the latch has been set.
112 //
113 // In the event of a race with `set`:
114 //

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected