Searched refs:counter (Results 1 – 2 of 2) sorted by relevance
13 counter: AtomicI32, field24 fn new(counter: i32) -> Result<Self, SystemError> { in new()25 if counter > 0 { in new()27 counter: AtomicI32::new(counter), in new()38 if self.counter.fetch_sub(1, Ordering::Release) <= 0 { in down()39 self.counter.fetch_add(1, Ordering::Relaxed); in down()50 self.counter.fetch_add(1, Ordering::Release); in up()
20 pub counter: u8, field47 counter: 0, in new()86 if let Some(res) = self.counter.checked_add(1) { in increment_counter()87 self.counter = res; in increment_counter()92 if let Some(res) = self.counter.checked_sub(1) { in decrement_counter()93 self.counter = res; in decrement_counter()