diff options
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r-- | src/include/gnunet_scheduler_lib.h | 31 |
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 | */ | ||
207 | typedef 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 | */ | ||
517 | GNUNET_SCHEDULER_select | ||
518 | GNUNET_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 | */ | ||
525 | GNUNET_SCHEDULER_select | ||
526 | GNUNET_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 |