From 02aaa9eeefb8f1c408ccf02cf3a2e7a2a7bed58d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 10 Nov 2009 19:45:42 +0000 Subject: allow any function in a task to easily get the reason code --- src/include/gnunet_scheduler_lib.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include/gnunet_scheduler_lib.h') diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 760a674d5..16fd2e807 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h @@ -241,6 +241,18 @@ unsigned int GNUNET_SCHEDULER_get_load (struct GNUNET_SCHEDULER_Handle *sched, enum GNUNET_SCHEDULER_Priority p); +/** + * Obtain the reason code for why the current task was + * started. Will return the same value as + * the GNUNET_SCHEDULER_TaskContext's reason field. + * + * @param sched scheduler to query + * @return reason(s) why the current task is run + */ +enum GNUNET_SCHEDULER_Reason +GNUNET_SCHEDULER_get_reason (struct GNUNET_SCHEDULER_Handle *sched); + + /** * Cancel the task with the specified identifier. * The task must not yet have run. -- cgit v1.2.3