Writing Device Drivers

Kernel Thread Control and Synchronization Functions

Table B–11 Kernel Thread Control and Synchronization Functions

Function Name 

Description 

cv_broadcast

wakeup all waiting threads 

cv_destroy 

free an allocated condition variable 

cv_init 

allocate a condition variable 

cv_signal 

wakeup one waiting thread 

cv_timedwait 

await an event with timeout 

cv_timedwait_sig 

await an event or signal with timeout 

cv_wait 

await an event 

cv_wait_sig 

await an event or signal 

ddi_enter_critical 

enter a critical region of control 

ddi_exit_critical 

exit a critical region of control 

mutex_destroy 

destroy mutual exclusion lock 

mutex_enter 

acquire mutual exclusion lock 

mutex_exit 

release mutual exclusion lock 

mutex_init 

initialize mutual exclusion lock 

mutex_owned 

determine if current thread is holding mutual exclusion lock 

mutex_tryenter 

attempt to acquire mutual exclusion lock without waiting 

rw_destroy 

destroy a readers/writer lock 

rw_downgrade 

downgrade a readers/writer lock holding from writer to reader 

rw_enter 

acquire a readers/writer lock 

rw_exit 

release a readers/writer lock 

rw_init 

initialize a readers/writer lock 

rw_read_locked 

determine whether readers/writer lock is held for read or write 

rw_tryenter 

attempt to acquire a readers/writer lock without waiting 

rw_tryupgrade 

attempt to upgrade readers/writer lock holding from reader to writer 

sema_destroy 

destroy a semaphore 

sema_init 

initialize a semaphore 

sema_p 

decrement semaphore and possibly block 

sema_p_sig 

decrement semaphore, but do not block if signal is pending 

sema_tryp 

attempt to decrement semaphore, but do not block 

sema_v 

increment semaphore and possibly unblock waiter