網絡子係統83_inet協議族-SOCK_RAW(四)
// raw sock數據就緒函數 // raw sock在raw_recvmsg中阻塞,在raw_local_deliver通過sock->sk_data_ready通知輸入數據就緒 // 步驟: // 1.過濾感興趣的事件 // 2.喚醒阻塞進程,並將進程從wq上取下 1.1 static int receiver_wake_function(wait_queue_t *wait, unsigned int mode, int sync, void *key) { unsigned long bits = (unsigned long)key; //POLLIN輸入數據就緒 //POLLER輸出數據就緒 if (bits && !(bits & (POLLIN | POLLERR))) return 0; //喚醒阻塞進程,並將進程從wq上取下 return autoremove_wake_function(wait, mode, sync, key); } // 喚醒阻塞進程,並將進程從wq上取下 1.2 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key) { int ret = default_wake_function(wait, mode, sync, key); if (ret) list_del_init(&wait->task_list); return ret; }
最後更新:2017-04-03 12:55:18