aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-08-25 12:59:28 +0200
committerlurchi <lurchi@strangeplace.net>2017-08-25 12:59:28 +0200
commit909c769cc09296f8abccf2a5ee6a6a687b4efc3a (patch)
tree3bbf74084373614c3ba61a60f1eb19ff73913827 /src
parentba7ceb320716f8a1b20883fccbdec15fee41002b (diff)
downloadgnunet-909c769cc09296f8abccf2a5ee6a6a687b4efc3a.tar.gz
gnunet-909c769cc09296f8abccf2a5ee6a6a687b4efc3a.zip
clarify documentation about adding / deleting tasks
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_scheduler_lib.h20
-rw-r--r--src/util/scheduler.c5
2 files changed, 15 insertions, 10 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 119f3c8ed..b6f127f0c 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -216,7 +216,8 @@ struct GNUNET_SCHEDULER_TaskContext
216 216
217/** 217/**
218 * Function used by event-loop implementations to signal the scheduler 218 * Function used by event-loop implementations to signal the scheduler
219 * that a particular @a task is ready due to an event of type @a et. 219 * that a particular @a task is ready due to an event specified in the
220 * et field of @a fdi.
220 * 221 *
221 * This function will then queue the task to notify the application 222 * This function will then queue the task to notify the application
222 * that the task is ready (with the respective priority). 223 * that the task is ready (with the respective priority).
@@ -268,8 +269,11 @@ struct GNUNET_SCHEDULER_Driver
268 void *cls; 269 void *cls;
269 270
270 /** 271 /**
271 * Add a @a task to be run if the conditions given 272 * Add a @a task to be run if the conditions specified in the
272 * in @a fdi are satisfied. 273 * et field of the given @a fdi are satisfied. The et field will
274 * be cleared after this call and the driver is expected to set
275 * the type of the actual event before passing @a fdi to
276 * #GNUNET_SCHEDULER_task_ready.
273 * 277 *
274 * @param cls closure 278 * @param cls closure
275 * @param task task to add 279 * @param task task to add
@@ -283,18 +287,18 @@ struct GNUNET_SCHEDULER_Driver
283 struct GNUNET_SCHEDULER_FdInfo *fdi); 287 struct GNUNET_SCHEDULER_FdInfo *fdi);
284 288
285 /** 289 /**
286 * Delete a @a task from the set of tasks to be run. 290 * Delete a @a task from the set of tasks to be run. A task may
291 * comprise multiple FdInfo entries previously added with the add
292 * function. The driver is expected to delete them all.
287 * 293 *
288 * @param cls closure 294 * @param cls closure
289 * @param task task to delete 295 * @param task task to delete
290 * @param fdi conditions to watch for (must match @e add call)
291 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 296 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
292 * (i.e. @a task or @a fdi do not match prior @e add call) 297 * (i.e. @a task does not match prior @e add call)
293 */ 298 */
294 int 299 int
295 (*del)(void *cls, 300 (*del)(void *cls,
296 struct GNUNET_SCHEDULER_Task *task, 301 struct GNUNET_SCHEDULER_Task *task);
297 struct GNUNET_SCHEDULER_FdInfo *fdi);
298 302
299 /** 303 /**
300 * Set time at which we definitively want to get a wakeup call. 304 * Set time at which we definitively want to get a wakeup call.
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 32916d99d..ac9494fa0 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -1829,12 +1829,13 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1829 1829
1830/** 1830/**
1831 * Function used by event-loop implementations to signal the scheduler 1831 * Function used by event-loop implementations to signal the scheduler
1832 * that a particular @a task is ready due to an event of type @a et. 1832 * that a particular @a task is ready due to an event specified in the
1833 * et field of @a fdi.
1833 * 1834 *
1834 * This function will then queue the task to notify the application 1835 * This function will then queue the task to notify the application
1835 * that the task is ready (with the respective priority). 1836 * that the task is ready (with the respective priority).
1836 * 1837 *
1837 * @param task the task that is ready, NULL for wake up calls 1838 * @param task the task that is ready
1838 * @param fdi information about the related FD 1839 * @param fdi information about the related FD
1839 */ 1840 */
1840void 1841void