(&self)
| 73 | } |
| 74 | |
| 75 | impl Latch { |
| 76 | /// Creates a new latch backed by the provided semaphore. |
| 77 | pub fn new(semaphore: &'static Semaphore) -> Latch { |
| 78 | Latch { |
| 79 | state: AtomicU32::new(LOCKED), |
| 80 | semaphore, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /// Checks to see if the latch has been set. |