aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scheduler_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-01 21:12:17 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-01 21:12:17 +0000
commit64c442461b84953230d3dc4e78cb649db6c54abc (patch)
tree49ec875b32ce171aac2bbae1b5fcaad516a94cf6 /src/include/gnunet_scheduler_lib.h
parent0413c7690e087a0514447a87bc8118b2a244c902 (diff)
downloadgnunet-64c442461b84953230d3dc4e78cb649db6c54abc.tar.gz
gnunet-64c442461b84953230d3dc4e78cb649db6c54abc.zip
changing scheduler priorities to revert to DEFAULT instead of inheriting parent-task priority unless something else is explicitly specified
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r--src/include/gnunet_scheduler_lib.h59
1 files changed, 45 insertions, 14 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 9b8c57ff3..e16ccc511 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -111,7 +111,9 @@ enum GNUNET_SCHEDULER_Priority
111 111
112 /** 112 /**
113 * Run with the default priority (normal 113 * Run with the default priority (normal
114 * P2P operations). Higher than BACKGROUND. 114 * P2P operations). Any task that is scheduled
115 * without an explicit priority being specified
116 * will run with this priority.
115 */ 117 */
116 GNUNET_SCHEDULER_PRIORITY_DEFAULT = 3, 118 GNUNET_SCHEDULER_PRIORITY_DEFAULT = 3,
117 119
@@ -262,7 +264,7 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p);
262 * * @return reason(s) why the current task is run 264 * * @return reason(s) why the current task is run
263 */ 265 */
264enum GNUNET_SCHEDULER_Reason 266enum GNUNET_SCHEDULER_Reason
265GNUNET_SCHEDULER_get_reason (); 267GNUNET_SCHEDULER_get_reason (void);
266 268
267 269
268/** 270/**
@@ -291,9 +293,24 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
291 293
292 294
293/** 295/**
296 * Continue the current execution with the given function. This is
297 * similar to the other "add" functions except that there is no delay
298 * and the reason code can be specified.
299 *
300 * @param task main function of the task
301 * @param task_cls closure for 'main'
302 * @param reason reason for task invocation
303 * @param priority priority to use for the task
304 */
305void
306GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, void *task_cls,
307 enum GNUNET_SCHEDULER_Reason reason,
308 enum GNUNET_SCHEDULER_Priority priority);
309
310
311/**
294 * Schedule a new task to be run after the specified prerequisite task 312 * Schedule a new task to be run after the specified prerequisite task
295 * has completed. It will be run with the priority of the calling 313 * has completed. It will be run with DEFAULT priority.
296 * task.
297 * 314 *
298 * * @param prerequisite_task run this task after the task with the given 315 * * @param prerequisite_task run this task after the task with the given
299 * task identifier completes (and any of our other 316 * task identifier completes (and any of our other
@@ -327,7 +344,7 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
327 344
328/** 345/**
329 * Schedule a new task to be run as soon as possible. The task 346 * Schedule a new task to be run as soon as possible. The task
330 * will be run with the priority of the calling task. 347 * will be run with the DEFAULT priority.
331 * 348 *
332 * * @param task main function of the task 349 * * @param task main function of the task
333 * @param task_cls closure of task 350 * @param task_cls closure of task
@@ -361,7 +378,7 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
361/** 378/**
362 * Schedule a new task to be run with a specified delay. The task 379 * Schedule a new task to be run with a specified delay. The task
363 * will be scheduled for execution once the delay has expired. It 380 * will be scheduled for execution once the delay has expired. It
364 * will be run with the priority of the calling task. 381 * will be run with the DEFAULT priority.
365 * 382 *
366 * * @param delay when should this operation time out? Use 383 * * @param delay when should this operation time out? Use
367 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 384 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
@@ -376,12 +393,29 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
376 393
377 394
378/** 395/**
396 * Schedule a new task to be run with a specified delay. The task
397 * will be scheduled for execution once the delay has expired.
398 *
399 * @param delay when should this operation time out? Use
400 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
401 * @param priority priority to use for the task
402 * @param task main function of the task
403 * @param task_cls closure of task
404 * @return unique task identifier for the job
405 * only valid until "task" is started!
406 */
407GNUNET_SCHEDULER_TaskIdentifier
408GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
409 enum GNUNET_SCHEDULER_Priority priority,
410 GNUNET_SCHEDULER_Task task, void *task_cls);
411
412
413/**
379 * Schedule a new task to be run with a specified delay or when the 414 * Schedule a new task to be run with a specified delay or when the
380 * specified file descriptor is ready for reading. The delay can be 415 * specified file descriptor is ready for reading. The delay can be
381 * used as a timeout on the socket being ready. The task will be 416 * used as a timeout on the socket being ready. The task will be
382 * scheduled for execution once either the delay has expired or the 417 * scheduled for execution once either the delay has expired or the
383 * socket operation is ready. It will be run with the priority of 418 * socket operation is ready. It will be run with the DEFAULT priority.
384 * the calling task.
385 * 419 *
386 * * @param delay when should this operation time out? Use 420 * * @param delay when should this operation time out? Use
387 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 421 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
@@ -402,8 +436,7 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
402 * specified file descriptor is ready for writing. The delay can be 436 * specified file descriptor is ready for writing. The delay can be
403 * used as a timeout on the socket being ready. The task will be 437 * used as a timeout on the socket being ready. The task will be
404 * scheduled for execution once either the delay has expired or the 438 * scheduled for execution once either the delay has expired or the
405 * socket operation is ready. It will be run with the priority of 439 * socket operation is ready. It will be run with the DEFAULT priority.
406 * the calling task.
407 * 440 *
408 * * @param delay when should this operation time out? Use 441 * * @param delay when should this operation time out? Use
409 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 442 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
@@ -424,8 +457,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
424 * specified file descriptor is ready for reading. The delay can be 457 * specified file descriptor is ready for reading. The delay can be
425 * used as a timeout on the socket being ready. The task will be 458 * used as a timeout on the socket being ready. The task will be
426 * scheduled for execution once either the delay has expired or the 459 * scheduled for execution once either the delay has expired or the
427 * socket operation is ready. It will be run with the priority of 460 * socket operation is ready. It will be run with the DEFAULT priority.
428 * the calling task.
429 * 461 *
430 * * @param delay when should this operation time out? Use 462 * * @param delay when should this operation time out? Use
431 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 463 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
@@ -446,8 +478,7 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
446 * specified file descriptor is ready for writing. The delay can be 478 * specified file descriptor is ready for writing. The delay can be
447 * used as a timeout on the socket being ready. The task will be 479 * used as a timeout on the socket being ready. The task will be
448 * scheduled for execution once either the delay has expired or the 480 * scheduled for execution once either the delay has expired or the
449 * socket operation is ready. It will be run with the priority of 481 * socket operation is ready. It will be run with the DEFAULT priority.
450 * the calling task.
451 * 482 *
452 * * @param delay when should this operation time out? Use 483 * * @param delay when should this operation time out? Use
453 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 484 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"