SilcSchedule schedule;
+void notify_cb(SilcSchedule schedule, SilcBool added, SilcTask task,
+ SilcBool fd_task, SilcUInt32 fd, long sec, long usec,
+ void *context)
+{
+ SILC_LOG_DEBUG(("Notify cb, %s %s task, fd %d, sec %d usec %d",
+ added ? "added" : "deleted", fd_task ? "fd" :"timeout",
+ fd, sec, usec));
+}
+
SILC_TASK_CALLBACK(foo)
{
silc_log_debug(TRUE);
silc_log_quick(TRUE);
silc_log_debug_hexdump(TRUE);
- silc_log_set_debug_string("*sched*,*hash*");
+ silc_log_set_debug_string("*sched*,*hash*,*errno*");
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(NUM_FTASK, NULL);
+ schedule = silc_schedule_init(NUM_FTASK, NULL, NULL);
if (!schedule)
goto err;
+ silc_schedule_set_notify(schedule, notify_cb, NULL);
silc_schedule_task_add_signal(schedule, SIGINT, interrupt, NULL);