- GNUNET_assert (wfd != NULL);
- ws = GNUNET_NETWORK_fdset_create ();
- GNUNET_NETWORK_fdset_handle_set (ws, wfd);
- ret =
- GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
- delay, NULL, ws,
- task, task_cls);
- GNUNET_NETWORK_fdset_destroy (ws);
+
+/**
+ * Schedule a new task to be run with a specified delay or when the
+ * specified file descriptor is ready. The delay can be
+ * used as a timeout on the socket being ready. The task will be
+ * scheduled for execution once either the delay has expired or the
+ * socket operation is ready.
+ *
+ * @param delay when should this operation time out? Use
+ * #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 @a task
+ * @return unique task identifier for the job
+ * only valid until @a task is started!
+ */
+struct GNUNET_SCHEDULER_Task *
+GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
+ enum GNUNET_SCHEDULER_Priority priority,
+ const struct GNUNET_DISK_FileHandle *fd,
+ int on_read, int on_write,
+ GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
+{
+#if MINGW
+ struct GNUNET_NETWORK_FDSet *s;
+ struct GNUNET_SCHEDULER_Task * ret;
+
+ GNUNET_assert (NULL != fd);
+ s = GNUNET_NETWORK_fdset_create ();
+ GNUNET_NETWORK_fdset_handle_set (s, fd);
+ ret = GNUNET_SCHEDULER_add_select (
+ priority, delay,
+ on_read ? s : NULL,
+ on_write ? s : NULL,
+ task, task_cls);
+ GNUNET_NETWORK_fdset_destroy (s);