+ SILC_LOG_DEBUG(("Allocate child scheduler"));
+ child = silc_schedule_init(0, NULL, NULL, schedule);
+ if (!child)
+ goto err;
+
+ SILC_LOG_DEBUG(("Allocate another child scheduler"));
+ child2 = silc_schedule_init(0, NULL, NULL, child);
+ if (!child2)
+ goto err;
+
+ SILC_LOG_DEBUG(("Add 'interrupted' event to child scheduler"));
+ if (!silc_schedule_task_add_event(child, "interrupted",
+ SILC_PARAM_PTR))
+ goto err;
+
+ SILC_LOG_DEBUG(("Add 'timeout' event to parent scheduler"));
+ timeout_event =
+ silc_schedule_task_add_event(schedule, "timeout");
+ if (!timeout_event)
+ goto err;
+
+ SILC_LOG_DEBUG(("Connect to 'interrupted' event in parent scheduler"));
+ if (!silc_schedule_event_connect(schedule, "interrupted", NULL,
+ interrupted_event, NULL))
+ goto err;
+
+ SILC_LOG_DEBUG(("Connect to 'timeout' event in child2 scheduler"));
+ if (!silc_schedule_event_connect(child2, NULL, timeout_event,
+ timeout_event_cb, NULL))
+ goto err;
+
+ SILC_LOG_DEBUG(("Add parent as global scheduler"));
+ silc_schedule_set_global(schedule);
+