* if no future timeout exists, select will wait infinit.
*/
-printf("-"); fflush(stdout);
again:
-printf("1"); fflush(stdout);
/* process all work events */
if (next_work()) {
-printf("2"); fflush(stdout);
work = 1;
goto again;
}
/* process timer events and get timeout for next timer event */
temp = 0;
timer = nearest_timer(&select_timer, &temp);
-printf("3"); fflush(stdout);
if (temp) {
-printf("4"); fflush(stdout);
work = 1;
goto again;
}
FD_ZERO(&writeset);
FD_ZERO(&exceptset);
-printf("5"); fflush(stdout);
/* prepare read and write fdsets */
lcr_fd = fd_first;
while(lcr_fd) {
FD_SET(lcr_fd->fd, &exceptset);
lcr_fd = lcr_fd->next;
}
-printf("6"); fflush(stdout);
if (unlock)
unlock();
*global_change = 0;
return 1;
}
-printf("7"); fflush(stdout);
/* fire timers */
#if 0
/* call registered callback functions */
restart:
-printf("8"); fflush(stdout);
unregistered = 0;
lcr_fd = fd_first;
while(lcr_fd) {
FD_CLR(lcr_fd->fd, &exceptset);
}
if (flags) {
-printf("9"); fflush(stdout);
work = 1;
lcr_fd->cb(lcr_fd, flags, lcr_fd->cb_instance, lcr_fd->cb_index);
if (unregistered)
goto restart;
-printf("-"); fflush(stdout);
return 1;
}
lcr_fd = lcr_fd->next;
#endif
}
-void trigger_work(struct lcr_work *work)
+void _trigger_work(struct lcr_work *work, const char *func)
{
if (!work->inuse) {
- FATAL("Work not added\n");
+ FATAL("Work not added, (called from func %s)\n", func);
}
/* event already triggered */