* Schedule a new task to be run with a specified priority.
*
* @param prio how important is the new task?
- * @param task main function of the @a task
- * @param task_cls closure of task
+ * @param task main function of the task
+ * @param task_cls closure of @a task
* @return unique task identifier for the job
* only valid until @a task is started!
*/
{
return GNUNET_SCHEDULER_add_net_with_priority (
delay, priority,
- rfd, true, false,
+ rfd, GNUNET_YES, GNUNET_NO,
task, task_cls);
}
{
return GNUNET_SCHEDULER_add_net_with_priority (
delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
- wfd, false, true,
+ wfd, GNUNET_NO, GNUNET_YES,
task, task_cls);
}
GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
struct GNUNET_NETWORK_Handle *fd,
- bool on_read, bool on_write,
+ int on_read, int on_write,
GNUNET_SCHEDULER_Task task, void *task_cls)
{
#if MINGW
{
return GNUNET_SCHEDULER_add_file_with_priority (
delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
- rfd, true, false,
+ rfd, GNUNET_YES, GNUNET_NO,
task, task_cls);
}
{
return GNUNET_SCHEDULER_add_file_with_priority (
delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
- wfd, false, true,
+ wfd, GNUNET_NO, GNUNET_YES,
task, task_cls);
}
+
/**
* Schedule a new task to be run with a specified delay or when the
* specified file descriptor is ready. The delay can be
* socket operation is ready.
*
* @param delay when should this operation time out? Use
- * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
+ * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
* @param priority priority of the task
* @param fd file-descriptor
* @param on_read whether to poll the file-descriptor for readability
* @param on_write whether to poll the file-descriptor for writability
* @param task main function of the task
- * @param task_cls closure of task
+ * @param task_cls closure of @a task
* @return unique task identifier for the job
- * only valid until "task" is started!
+ * only valid until @a task is started!
*/
GNUNET_SCHEDULER_TaskIdentifier
GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
const struct GNUNET_DISK_FileHandle *fd,
- bool on_read, bool on_write,
+ int on_read, int on_write,
GNUNET_SCHEDULER_Task task, void *task_cls)
{
#if MINGW
int real_fd;
GNUNET_DISK_internal_file_handle_ (fd, &real_fd, sizeof (int));
- GNUNET_assert (real_fd > 0);
+ GNUNET_assert (real_fd >= 0);
return add_without_sets (
delay, priority,
on_read ? real_fd : -1,