Function gnunet_sys::GNUNET_SCHEDULER_run[][src]

pub unsafe extern "C" fn GNUNET_SCHEDULER_run(
    task: GNUNET_SCHEDULER_TaskCallback,
    task_cls: *mut c_void
)

Initialize and run scheduler. This function will return when all tasks have completed. On systems with signals, receiving a SIGTERM (and other similar signals) will cause #GNUNET_SCHEDULER_shutdown to be run after the active task is complete. As a result, SIGTERM causes all shutdown tasks to be scheduled with reason #GNUNET_SCHEDULER_REASON_SHUTDOWN. (However, tasks added afterwards will execute normally!). Note that any particular signal will only shut down one scheduler; applications should always only create a single scheduler.

@param task task to run first (and immediately) @param task_cls closure of @a task