MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / wait

Method wait

flow-rs/src/graph/context.rs:39–56  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

37 self.is_closed.load(Ordering::Relaxed)
38 }
39 pub async fn wait(&self) {
40 let mut listener = None;
41
42 loop {
43 if self.is_closed.load(Ordering::Relaxed) {
44 return;
45 }
46
47 match listener.take() {
48 None => {
49 listener = Some(self.lock_ops.listen());
50 }
51 Some(l) => {
52 l.await;
53 }
54 }
55 }
56 }
57}
58
59lazy_static::lazy_static! {

Callers 2

startMethod · 0.45
dmonMethod · 0.45

Calls 3

loadMethod · 0.80
takeMethod · 0.80
listenMethod · 0.80

Tested by

no test coverage detected