aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-08-03 09:44:26 +0000
committerChristian Grothoff <christian@grothoff.org>2015-08-03 09:44:26 +0000
commit0f9c537f66e4f8eaaceb22ec007dac559133e0d6 (patch)
tree9cf8eb110f1dcf5e8912c95bd45fecb143c832a9
parentd3e7a5e40dd2d5409009a30e1e41148c4d852673 (diff)
downloadgnunet-0f9c537f66e4f8eaaceb22ec007dac559133e0d6.tar.gz
gnunet-0f9c537f66e4f8eaaceb22ec007dac559133e0d6.zip
eliminate dead GNUNET_SCHEDULER_add_continuation, rename GNUNET_SCHEDULER_add_continuation_with_priority to GNUNET_SCHEDULER_add_with_reason_and_priority for consistency
-rw-r--r--src/include/gnunet_scheduler_lib.h23
-rw-r--r--src/util/scheduler.c34
2 files changed, 12 insertions, 45 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index a80ef5129..081d4bff2 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -221,30 +221,15 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task);
221 * and the reason code can be specified. 221 * and the reason code can be specified.
222 * 222 *
223 * @param task main function of the task 223 * @param task main function of the task
224 * @param task_cls closure of task
225 * @param reason reason for task invocation
226 */
227void
228GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_TaskCallback task,
229 void *task_cls,
230 enum GNUNET_SCHEDULER_Reason reason);
231
232
233/**
234 * Continue the current execution with the given function. This is
235 * similar to the other "add" functions except that there is no delay
236 * and the reason code can be specified.
237 *
238 * @param task main function of the task
239 * @param task_cls closure for @a task 224 * @param task_cls closure for @a task
240 * @param reason reason for task invocation 225 * @param reason reason for task invocation
241 * @param priority priority to use for the task 226 * @param priority priority to use for the task
242 */ 227 */
243void 228void
244GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback task, 229GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback task,
245 void *task_cls, 230 void *task_cls,
246 enum GNUNET_SCHEDULER_Reason reason, 231 enum GNUNET_SCHEDULER_Reason reason,
247 enum GNUNET_SCHEDULER_Priority priority); 232 enum GNUNET_SCHEDULER_Priority priority);
248 233
249 234
250/** 235/**
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 11e7966ff..fe9d89d69 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -757,9 +757,10 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
757#endif 757#endif
758 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; 758 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
759 current_lifeness = GNUNET_YES; 759 current_lifeness = GNUNET_YES;
760 GNUNET_SCHEDULER_add_continuation (task, 760 GNUNET_SCHEDULER_add_with_reason_and_priority (task,
761 task_cls, 761 task_cls,
762 GNUNET_SCHEDULER_REASON_STARTUP); 762 GNUNET_SCHEDULER_REASON_STARTUP,
763 GNUNET_SCHEDULER_PRIORITY_DEFAULT);
763 active_task = (void *) (long) -1; /* force passing of sanity check */ 764 active_task = (void *) (long) -1; /* force passing of sanity check */
764 GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO, 765 GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO,
765 &GNUNET_OS_install_parent_control_handler, 766 &GNUNET_OS_install_parent_control_handler,
@@ -1004,10 +1005,10 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task)
1004 * @param priority priority to use for the task 1005 * @param priority priority to use for the task
1005 */ 1006 */
1006void 1007void
1007GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback task, 1008GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback task,
1008 void *task_cls, 1009 void *task_cls,
1009 enum GNUNET_SCHEDULER_Reason reason, 1010 enum GNUNET_SCHEDULER_Reason reason,
1010 enum GNUNET_SCHEDULER_Priority priority) 1011 enum GNUNET_SCHEDULER_Priority priority)
1011{ 1012{
1012 struct GNUNET_SCHEDULER_Task *t; 1013 struct GNUNET_SCHEDULER_Task *t;
1013 1014
@@ -1042,25 +1043,6 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback t
1042 1043
1043 1044
1044/** 1045/**
1045 * Continue the current execution with the given function. This is
1046 * similar to the other "add" functions except that there is no delay
1047 * and the reason code can be specified.
1048 *
1049 * @param task main function of the task
1050 * @param task_cls closure for @a task
1051 * @param reason reason for task invocation
1052 */
1053void
1054GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_TaskCallback task, void *task_cls,
1055 enum GNUNET_SCHEDULER_Reason reason)
1056{
1057 GNUNET_SCHEDULER_add_continuation_with_priority (task, task_cls,
1058 reason,
1059 GNUNET_SCHEDULER_PRIORITY_DEFAULT);
1060}
1061
1062
1063/**
1064 * Schedule a new task to be run with a specified delay. The task 1046 * Schedule a new task to be run with a specified delay. The task
1065 * will be scheduled for execution once the delay has expired. 1047 * will be scheduled for execution once the delay has expired.
1066 * 1048 *