最終更新:2013-01-24 (木) 04:04:55 (4082d)
wait_event_timeout
Top / wait_event_timeout
sleep until a condition gets true or a timeout elapses
long wait_event_timeout(wait_queue_head_t wq, int condition, int timeout)
イベント待ちを一定の時間が経過したら解除
概要
- The process is put to sleep (TASK_UNINTERRUPTIBLE) until the condition evaluates to true. The condition is checked each time the waitqueue wq is woken up.
- wake_up has to be called after changing any variable that could change the result of the wait condition.
- The function returns 0 if the timeout elapsed, and the remaining jiffies if the condition evaluated to true before the timeout elapsed.
パラメータ
wait_queue_head_t wq
- ワークキューのヘッド。値渡しする。
condition
- 任意の論理式。スリープの前後にマクロによって評価される
戻り値
- タイムアウトしたとき、0
- 時間内に条件が整ったときには、タイムアウトからの残りのjiffyタイム
起こす関数
- wake_up(wait_queue_head_t *queue) - 指定したワークキュー上で待っているすべてのプロセスを起こす
- wake_up_interruptible(wait_queue_head_t *queue) - 指定したワークキュー上で待っている割り込み可能なスリープ中のプロセスを起こす
関連
- wait_event
- wait_event_interruptible - イベント待ちの間に割り込みを許可