Home
last modified time | relevance | path

Searched refs:counter (Results 1 – 4 of 4) sorted by relevance

/DragonOS-0.1.7/kernel/src/libs/
Dsemaphore.rs10 counter: AtomicI32, field
21 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()
Dsemaphore.c8 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()
/DragonOS-0.1.7/kernel/src/common/
Dsemaphore.h23 atomic_t counter; member
36 atomic_set(&sema->counter, count); in semaphore_init()
/DragonOS-0.1.7/kernel/src/driver/usb/xhci/
Dxhci.h329 uint16_t counter; member