Linux中非阻塞驱动

tech2022-11-25  93

unsigned int (*poll) (struct file *file, struct poll_table_struct *wait)

是fileo_operations中一个操作项应用程序中的poll与select与epoll都会访问这个函数,其返回值决定了其状态

static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)

是将filp加入wait_address等待队列项中

#define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL)

进入休眠的线程可以通过wake_up唤醒

 

最新回复(0)