Wait at the gate. Only blocks if the gate is not opened.
(&self)
| 28 | |
| 29 | /// Wait at the gate. Only blocks if the gate is not opened. |
| 30 | pub fn wait(&self) { |
| 31 | let mut open = self.open.lock().unwrap(); |
| 32 | while !*open { |
| 33 | open = self.cv.wait(open).unwrap(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /// Open the gate, releasing all waiting threads. |
| 38 | pub fn open(&self) { |
no outgoing calls