Writing Device Drivers

Semaphores

Counting semaphores are available as an alternative primitive for managing threads within device drivers. See semaphore(9F) for more information.

Table 3-3 Semaphores

Name 

Description 

sema_init(9F) 

Initialize a semaphore 

sema_destroy(9F) 

Destroys a semaphore 

sema_p(9F) 

Decrement semaphore and possibly block 

sema_tryp(9F) 

Attempt to decrement semaphore, but do not block 

sema_p_sig(9F) 

Decrement semaphore, but do not block if signal is pending 

sema_v(9F) 

Increment semaphore and possibly unblock waiter