Searched refs:counter (Results 1 – 4 of 4) sorted by relevance
10 counter: AtomicI32, field21 fn new(counter: i32) -> Result<Self, SystemError> { in new()22 if counter > 0 { in new()24 counter: AtomicI32::new(counter), in new()35 if self.counter.fetch_sub(1, Ordering::Release) <= 0 { in down()36 self.counter.fetch_add(1, Ordering::Relaxed); in down()47 self.counter.fetch_add(1, Ordering::Release); in up()
8 if (atomic_read(&sema->counter) > 0) // 信号量大于0,资源充足 in semaphore_down()9 atomic_dec(&sema->counter); in semaphore_down()30 atomic_inc(&sema->counter); in semaphore_up()
23 atomic_t counter; member36 atomic_set(&sema->counter, count); in semaphore_init()
329 uint16_t counter; member