| Unreliable Guide To Hacking The Linux Kernel | ||
|---|---|---|
| <<< Previous | Next >>> | |
[SLEEPS]
A wait queue is used to wait for someone to wake you up when a certain condition is true. They must be used carefully to ensure there is no race condition. You declare a wait_queue_head_t, and then processes which want to wait for that condition declare a wait_queue_t referring to themselves, and place that in the queue.
You declare a wait_queue_head_t using the DECLARE_WAIT_QUEUE_HEAD() macro, or using the init_waitqueue_head() routine in your initialization code.
| <<< Previous | Home | Next >>> |
| MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT include/linux/module.h | Queuing |