aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-11-13 11:38:19 +0000
committerChristian Grothoff <christian@grothoff.org>2009-11-13 11:38:19 +0000
commit70de2534e40ac0768f0f0d62a2b9d7bc593fba82 (patch)
treef3aed7740cc203b430999f2c9355a217c7aeb24b /src
parent9cd258d4831daf2cf68db9a9d22717287bdfa70b (diff)
downloadgnunet-70de2534e40ac0768f0f0d62a2b9d7bc593fba82.tar.gz
gnunet-70de2534e40ac0768f0f0d62a2b9d7bc593fba82.zip
add now
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_scheduler_lib.h16
-rw-r--r--src/util/scheduler.c25
2 files changed, 41 insertions, 0 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 16fd2e807..283d46dab 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -324,6 +324,22 @@ GNUNET_SCHEDULER_add_with_priority (struct GNUNET_SCHEDULER_Handle *sched,
324 324
325 325
326/** 326/**
327 * Schedule a new task to be run as soon as possible. The task
328 * will be run with the priority of the calling task.
329 *
330 * @param sched scheduler to use
331 * @param task main function of the task
332 * @param task_cls closure of task
333 * @return unique task identifier for the job
334 * only valid until "task" is started!
335 */
336GNUNET_SCHEDULER_TaskIdentifier
337GNUNET_SCHEDULER_add_now (struct GNUNET_SCHEDULER_Handle *sched,
338 GNUNET_SCHEDULER_Task task,
339 void *task_cls);
340
341
342/**
327 * Schedule a new task to be run with a specified delay. The task 343 * Schedule a new task to be run with a specified delay. The task
328 * will be scheduled for execution once the delay has expired. It 344 * will be scheduled for execution once the delay has expired. It
329 * will be run with the priority of the calling task. 345 * will be run with the priority of the calling task.
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index ee4a9a4f3..1df907a20 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -832,6 +832,31 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_SCHEDULER_Handle * sched,
832} 832}
833 833
834 834
835
836/**
837 * Schedule a new task to be run as soon as possible. The task
838 * will be run with the priority of the calling task.
839 *
840 * @param sched scheduler to use
841 * @param task main function of the task
842 * @param task_cls closure of task
843 * @return unique task identifier for the job
844 * only valid until "task" is started!
845 */
846GNUNET_SCHEDULER_TaskIdentifier
847GNUNET_SCHEDULER_add_now (struct GNUNET_SCHEDULER_Handle *sched,
848 GNUNET_SCHEDULER_Task task,
849 void *task_cls)
850{
851 return GNUNET_SCHEDULER_add_select (sched,
852 GNUNET_SCHEDULER_PRIORITY_KEEP,
853 GNUNET_SCHEDULER_NO_TASK,
854 GNUNET_TIME_UNIT_ZERO,
855 NULL, NULL, task, task_cls);
856}
857
858
859
835/** 860/**
836 * Schedule a new task to be run with a specified delay or when the 861 * Schedule a new task to be run with a specified delay or when the
837 * specified file descriptor is ready for reading. The delay can be 862 * specified file descriptor is ready for reading. The delay can be