- 论坛徽章:
- 0
|
最近再看内核代码中关于USB的部分,内核会专门设立一个khubd进程处理USB Hub的相关信息,程序如下:
请问signal_pending(current)函数的作用是什么?如果有USB设备插入到HUB的PORT,那么,是怎样让内核
调度这个进程处理的?希望各位能提供一些帮助
static int hub_thread(void *__unused)
{
/*
* This thread doesn't need any user-level access,
* so get rid of all our resources
*/
daemonize("khubd");
allow_signal(SIGKILL);
/* Send me a signal to get me die (for debugging) */
do {
hub_events();
wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
try_to_freeze(PF_FREEZE);
} while (!signal_pending(current));
pr_debug ("%s: khubd exiting\n", usbcore_name);
complete_and_exit(&khubd_exited, 0);
} |
|