+SILC_TASK_CALLBACK(silc_schedule_wakeup_init)
+{
+ SilcUnixScheduler internal = schedule->internal;
+
+ internal->wakeup_task =
+ silc_schedule_task_add(schedule, internal->wakeup_pipe[0],
+ silc_schedule_wakeup_cb, internal,
+ 0, 0, SILC_TASK_FD);
+ if (!internal->wakeup_task) {
+ SILC_LOG_WARNING(("Could not add a wakeup task, threads won't work"));
+ close(internal->wakeup_pipe[0]);
+ return;
+ }
+ silc_schedule_internal_schedule_fd(schedule, internal,
+ (SilcTaskFd)internal->wakeup_task,
+ SILC_TASK_READ);
+}