有一個代碼,我不明白,如果有任何代碼的一部分,導致退出循環而不退出整個程序。什麼時候結束?
下面是代碼:
/* per-packet event loop */
while (true)
{
perf_push (PERF_EVENT_LOOP);
/* wait on tun/socket list */
multi_get_timeout (&multi, &multi.top.c2.timeval);
status = multi_tcp_wait (&multi.top, multi.mtcp);
MULTI_CHECK_SIG (&multi);
/* check on status of coarse timers */
multi_process_per_second_timers (&multi);
/* timeout? */
if (status > 0)
{
/* process the I/O which triggered select */
multi_tcp_process_io (&multi);
MULTI_CHECK_SIG (&multi);
}
else if (status == 0)
{
multi_tcp_action (&multi, NULL, TA_TIMEOUT, false);
}
perf_pop();
}
/* shut down management interface */
uninit_management_callback_multi (&multi);
是最後一行到達?
您是否嘗試在某些縮進處使用匹配圓括號縮進內部代碼塊? – 2012-07-18 06:09:58
你試着去了解什麼?調試? – 2012-07-18 06:10:55
我看到'while(true)'而不是單個'break'或'return'語句... – Mysticial 2012-07-18 06:11:30