aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scheduler_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-14 11:08:43 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-14 11:08:43 +0000
commit53da062e08f1d1d4392b3a40396bb45cc093e2ac (patch)
tree40b132f38c1d6b46476bfd9c1917070956ce4861 /src/include/gnunet_scheduler_lib.h
parent1debac4608e78f4a7800252ba9a91b4f5a376b42 (diff)
downloadgnunet-53da062e08f1d1d4392b3a40396bb45cc093e2ac.tar.gz
gnunet-53da062e08f1d1d4392b3a40396bb45cc093e2ac.zip
LRN: Added-the-ability-to-substitute-scheduler-select.
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r--src/include/gnunet_scheduler_lib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index ce3261f0a..6b927bba8 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -195,6 +195,20 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
195 195
196 196
197/** 197/**
198 * Signature of the select function used by the scheduler.
199 * GNUNET_NETWORK_socket_select matches it.
200 *
201 * @param rfds set of sockets to be checked for readability
202 * @param wfds set of sockets to be checked for writability
203 * @param efds set of sockets to be checked for exceptions
204 * @param timeout relative value when to return
205 * @return number of selected sockets, GNUNET_SYSERR on error
206 */
207typedef int (*GNUNET_SCHEDULER_select) (struct GNUNET_NETWORK_FDSet *rfds,
208 struct GNUNET_NETWORK_FDSet *wfds,
209 struct GNUNET_NETWORK_FDSet *efds,
210 struct GNUNET_TIME_Relative timeout);
211/**
198 * Initialize and run scheduler. This function will return when all 212 * Initialize and run scheduler. This function will return when all
199 * tasks have completed. On systems with signals, receiving a SIGTERM 213 * tasks have completed. On systems with signals, receiving a SIGTERM
200 * (and other similar signals) will cause "GNUNET_SCHEDULER_shutdown" 214 * (and other similar signals) will cause "GNUNET_SCHEDULER_shutdown"
@@ -494,6 +508,23 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
494 GNUNET_SCHEDULER_Task task, 508 GNUNET_SCHEDULER_Task task,
495 void *task_cls); 509 void *task_cls);
496 510
511/**
512 * Sets the select function to use in the scheduler (scheduler_select).
513 *
514 * @param new_select new select function to use
515 * @return previously used select function
516 */
517GNUNET_SCHEDULER_select
518GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select);
519
520/**
521 * Gets the select function currently used in the scheduler.
522 *
523 * @return currently used select function
524 */
525GNUNET_SCHEDULER_select
526GNUNET_SCHEDULER_get_select ();
527
497#if 0 /* keep Emacsens' auto-indent happy */ 528#if 0 /* keep Emacsens' auto-indent happy */
498{ 529{
499#endif 530#endif