Linux 内核 v.5。 linux/wait.h WAIT_QUEUE_HEAD
Linux Kernel v.5. linux/wait.h WAIT_QUEUE_HEAD
kernel v5有没有类似interruptible_sleep_on()的函数?
我只找到 poll_wait() 用于轮询文件。
在 linux 3.5 source code 中,我们可以看到那些函数已被弃用。看看他们声明上面的评论:
/*
* These are the old interfaces to sleep waiting for an event.
* They are racy. DO NOT use them, use the wait_event* interfaces above.
* We plan to remove these interfaces.
*/
extern void sleep_on(wait_queue_head_t *q);
extern long sleep_on_timeout(wait_queue_head_t *q,
signed long timeout);
extern void interruptible_sleep_on(wait_queue_head_t *q);
extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
signed long timeout);
要使用的函数是:wait_event_killable(), wait_event_timeout(), .. .
kernel v5有没有类似interruptible_sleep_on()的函数? 我只找到 poll_wait() 用于轮询文件。
在 linux 3.5 source code 中,我们可以看到那些函数已被弃用。看看他们声明上面的评论:
/*
* These are the old interfaces to sleep waiting for an event.
* They are racy. DO NOT use them, use the wait_event* interfaces above.
* We plan to remove these interfaces.
*/
extern void sleep_on(wait_queue_head_t *q);
extern long sleep_on_timeout(wait_queue_head_t *q,
signed long timeout);
extern void interruptible_sleep_on(wait_queue_head_t *q);
extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
signed long timeout);
要使用的函数是:wait_event_killable(), wait_event_timeout(), .. .