gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9480 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r9480 - in gnunet/src: include util
Date: Fri, 13 Nov 2009 04:38:19 -0700

Author: grothoff
Date: 2009-11-13 04:38:19 -0700 (Fri, 13 Nov 2009)
New Revision: 9480

Modified:
   gnunet/src/include/gnunet_scheduler_lib.h
   gnunet/src/util/scheduler.c
Log:
add now

Modified: gnunet/src/include/gnunet_scheduler_lib.h
===================================================================
--- gnunet/src/include/gnunet_scheduler_lib.h   2009-11-13 11:23:29 UTC (rev 
9479)
+++ gnunet/src/include/gnunet_scheduler_lib.h   2009-11-13 11:38:19 UTC (rev 
9480)
@@ -324,6 +324,22 @@
 
 
 /**
+ * Schedule a new task to be run as soon as possible. The task
+ * will be run with the priority of the calling task.
+ *
+ * @param sched scheduler to use
+ * @param task main function of the task
+ * @param task_cls closure of task
+ * @return unique task identifier for the job
+ *         only valid until "task" is started!
+ */
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_now (struct GNUNET_SCHEDULER_Handle *sched,
+                         GNUNET_SCHEDULER_Task task,
+                         void *task_cls);
+
+
+/**
  * Schedule a new task to be run with a specified delay.  The task
  * will be scheduled for execution once the delay has expired. It
  * will be run with the priority of the calling task.

Modified: gnunet/src/util/scheduler.c
===================================================================
--- gnunet/src/util/scheduler.c 2009-11-13 11:23:29 UTC (rev 9479)
+++ gnunet/src/util/scheduler.c 2009-11-13 11:38:19 UTC (rev 9480)
@@ -832,7 +832,32 @@
 }
 
 
+
 /**
+ * Schedule a new task to be run as soon as possible. The task
+ * will be run with the priority of the calling task.
+ *
+ * @param sched scheduler to use
+ * @param task main function of the task
+ * @param task_cls closure of task
+ * @return unique task identifier for the job
+ *         only valid until "task" is started!
+ */
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_now (struct GNUNET_SCHEDULER_Handle *sched,
+                         GNUNET_SCHEDULER_Task task,
+                         void *task_cls)
+{
+  return GNUNET_SCHEDULER_add_select (sched,
+                                      GNUNET_SCHEDULER_PRIORITY_KEEP,
+                                      GNUNET_SCHEDULER_NO_TASK,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                      NULL, NULL, task, task_cls);
+}
+
+
+
+/**
  * Schedule a new task to be run with a specified delay or when the
  * specified file descriptor is ready for reading.  The delay can be
  * used as a timeout on the socket being ready.  The task will be





reply via email to

[Prev in Thread] Current Thread [Next in Thread]