- 论坛徽章:
- 0
|
谢谢!
确认过了,jiffy的初始值是那样的。
拿到os代码了,查了一下,不知道下面的代码是不是是poll的实现
static int do_poll(unsigned int nfds, struct poll_list *list,
struct poll_wqueues *wait, long timeout)
{
int count = 0;
poll_table* pt = &wait->pt;
if (!timeout)
pt = NULL;
for (; {
struct poll_list *walk;
set_current_state(TASK_INTERRUPTIBLE);
walk = list;
while(walk != NULL) {
do_pollfd( walk->len, walk->entries, &pt, &count);
walk = walk->next;
}
pt = NULL;
if (count || !timeout || signal_pending(current))
break;
count = wait->error;
if (count)
break;
timeout = schedule_timeout(timeout);
}
__set_current_state(TASK_RUNNING);
return count;
}
从这段代码看,
可能的原因就是是不是thread不停的收到singal,
所以就直接return了。
但是当时没有连接,不应该收到signal而wakeup的啊! |
|