*
* NAME
*
- * typedef enum { ... } SilcTaskPriority
+ * typedef enum { ... } SilcTaskPriority;
*
* DESCRIPTION
*
* SYNOPSIS
*
* typedef void (*SilcTaskCallback)(SilcSchedule schedule,
- * SilcTaskEvent type, uint32 fd,
+ * SilcTaskEvent type, SilcUInt32 fd,
* void *context);
*
* DESCRIPTION
*
***/
typedef void (*SilcTaskCallback)(SilcSchedule schedule, SilcTaskEvent type,
- uint32 fd, void *context);
+ SilcUInt32 fd, void *context);
/* Macros */
*/
#define SILC_TASK_CALLBACK(func) \
static void func(SilcSchedule schedule, SilcTaskEvent type, \
- uint32 fd, void *context)
+ SilcUInt32 fd, void *context)
/***/
/****d* silcutil/SilcScheduleAPI/SILC_TASK_CALLBACK_GLOBAL
*/
#define SILC_TASK_CALLBACK_GLOBAL(func) \
void func(SilcSchedule schedule, SilcTaskEvent type, \
- uint32 fd, void *context)
+ SilcUInt32 fd, void *context)
/***/
/* Prototypes */
***/
bool silc_schedule_uninit(SilcSchedule schedule);
+/****f* silcutil/SilcScheduleAPI/silc_schedule_reinit
+ *
+ * SYNOPSIS
+ *
+ * SilcSchedule silc_schedule_reinit(int max_tasks);
+ *
+ * DESCRIPTION
+ *
+ * This function can be called to enlarge the task handling capabilities
+ * of the scheduler indicated by `schedule'. The `max_tasks' must be
+ * larger than what was set in silc_schedule_init function. This function
+ * returns FALSE if it cannot reinit the scheduler. This function does
+ * not do anything else except ready the scheduler to handle `max_tasks'
+ * number of tasks after this function returns. It is safe to call this
+ * function at any time, and it is guaranteed that existing tasks remain
+ * as they are in the scheduler.
+ *
+ ***/
+bool silc_schedule_reinit(SilcSchedule schedule, int max_tasks);
+
/****f* silcutil/SilcScheduleAPI/silc_schedule_stop
*
* SYNOPSIS
*
* Stops the scheduler even if it is not supposed to be stopped yet.
* After calling this, one must call silc_schedule_uninit (after the
- * silc_schedule has returned).
+ * silc_schedule has returned). After this is called it is guaranteed
+ * that next time the scheduler enters the main loop it will be stopped.
+ * However, untill it enters the main loop it will not detect that
+ * it is stopped for example if this is called from another thread.
*
***/
void silc_schedule_stop(SilcSchedule schedule);
*
* SYNOPSIS
*
- * SilcTask silc_schedule_task_add(SilcSchedule schedule, uint32 fd,
+ * SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
* SilcTaskCallback callback,
* void *context,
* long seconds, long useconds,
* in other threads as well.
*
***/
-SilcTask silc_schedule_task_add(SilcSchedule schedule, uint32 fd,
+SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
SilcTaskCallback callback, void *context,
long seconds, long useconds,
SilcTaskType type,
*
* SYNOPSIS
*
- * void silc_schedule_task_del_by_fd(SilcSchedule schedule, uint32 fd);
+ * void silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd);
*
* DESCRIPTION
*
* since generic tasks does not match any specific fd.
*
***/
-void silc_schedule_task_del_by_fd(SilcSchedule schedule, uint32 fd);
+void silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd);
/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_callback
*
*
* SYNOPSIS
*
- * void silc_schedule_set_listen_fd(SilcSchedule schedule, uint32 fd,
+ * void silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
* SilcTaskEvent mask);
*
* DESCRIPTION
* times to change the events.
*
***/
-void silc_schedule_set_listen_fd(SilcSchedule schedule, uint32 fd,
+void silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
SilcTaskEvent mask);
/****f* silcutil/SilcScheduleAPI/silc_schedule_unset_listen_fd
*
* SYNOPSIS
*
- * void silc_schedule_unset_listen_fd(SilcSchedule schedule, uint32 fd);
+ * void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd);
*
* DESCRIPTION
*
* after calling this function.
*
***/
-void silc_schedule_unset_listen_fd(SilcSchedule schedule, uint32 fd);
+void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd);
#endif