aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scheduler_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-14 11:12:46 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-14 11:12:46 +0000
commita2ed50e8e82e1d4f60302c30f9d748f7698b7cec (patch)
tree223239f9e17b485924c8cd52b8bd55f657061d7b /src/include/gnunet_scheduler_lib.h
parent53da062e08f1d1d4392b3a40396bb45cc093e2ac (diff)
downloadgnunet-a2ed50e8e82e1d4f60302c30f9d748f7698b7cec.tar.gz
gnunet-a2ed50e8e82e1d4f60302c30f9d748f7698b7cec.zip
remove getter, make global static, add closure argument
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r--src/include/gnunet_scheduler_lib.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 6b927bba8..723f8ca91 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -198,16 +198,18 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
198 * Signature of the select function used by the scheduler. 198 * Signature of the select function used by the scheduler.
199 * GNUNET_NETWORK_socket_select matches it. 199 * GNUNET_NETWORK_socket_select matches it.
200 * 200 *
201 * @param cls closure
201 * @param rfds set of sockets to be checked for readability 202 * @param rfds set of sockets to be checked for readability
202 * @param wfds set of sockets to be checked for writability 203 * @param wfds set of sockets to be checked for writability
203 * @param efds set of sockets to be checked for exceptions 204 * @param efds set of sockets to be checked for exceptions
204 * @param timeout relative value when to return 205 * @param timeout relative value when to return
205 * @return number of selected sockets, GNUNET_SYSERR on error 206 * @return number of selected sockets, GNUNET_SYSERR on error
206 */ 207 */
207typedef int (*GNUNET_SCHEDULER_select) (struct GNUNET_NETWORK_FDSet *rfds, 208typedef int (*GNUNET_SCHEDULER_select) (void *cls,
208 struct GNUNET_NETWORK_FDSet *wfds, 209 struct GNUNET_NETWORK_FDSet *rfds,
209 struct GNUNET_NETWORK_FDSet *efds, 210 struct GNUNET_NETWORK_FDSet *wfds,
210 struct GNUNET_TIME_Relative timeout); 211 struct GNUNET_NETWORK_FDSet *efds,
212 struct GNUNET_TIME_Relative timeout);
211/** 213/**
212 * Initialize and run scheduler. This function will return when all 214 * Initialize and run scheduler. This function will return when all
213 * tasks have completed. On systems with signals, receiving a SIGTERM 215 * tasks have completed. On systems with signals, receiving a SIGTERM
@@ -511,19 +513,13 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
511/** 513/**
512 * Sets the select function to use in the scheduler (scheduler_select). 514 * Sets the select function to use in the scheduler (scheduler_select).
513 * 515 *
514 * @param new_select new select function to use 516 * @param new_select new select function to use (NULL to reset to default)
515 * @return previously used select function 517 * @param new_select_cls closure for 'new_select'
516 */ 518 */
517GNUNET_SCHEDULER_select 519void
518GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select); 520GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
521 void *new_select_cls);
519 522
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 523
528#if 0 /* keep Emacsens' auto-indent happy */ 524#if 0 /* keep Emacsens' auto-indent happy */
529{ 525{