aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scheduler_lib.h
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-05-10 20:08:01 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-05-10 20:10:02 +0200
commitc1f06ac28fef5498952994e0399312b1fc567f22 (patch)
treead71f80bb08bfe20ff33880509263d78f334409b /src/include/gnunet_scheduler_lib.h
parentd1d18e6492708a0ce758ddd8c509f21b0ecbf6a0 (diff)
downloadgnunet-c1f06ac28fef5498952994e0399312b1fc567f22.tar.gz
gnunet-c1f06ac28fef5498952994e0399312b1fc567f22.zip
Implement asynchronous scope identifiers.
Without entering an asynchronous scope, logs are the same before. When entering an asynchronous scope (either thread-based of scheduler/task-based), all log lines within an asynchronous scope contain its ID. Currently this is only used in GNU Taler, for debugging requests across multiple services. This allows us to get all log lines pertaining to a particular request for a user or another service.
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r--src/include/gnunet_scheduler_lib.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 3f4e3c9a8..3f0350f54 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -214,6 +214,8 @@ struct GNUNET_SCHEDULER_TaskContext
214}; 214};
215 215
216 216
217
218
217/** 219/**
218 * Function used by event-loop implementations to signal the scheduler 220 * Function used by event-loop implementations to signal the scheduler
219 * that a particular @a task is ready due to an event specified in the 221 * that a particular @a task is ready due to an event specified in the
@@ -904,6 +906,24 @@ GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
904 void *new_select_cls); 906 void *new_select_cls);
905 907
906 908
909
910/**
911 * Change the async scope for the currently executing task and (transitively)
912 * for all tasks scheduled by the current task after calling this function.
913 * Nested tasks can begin their own nested async scope.
914 *
915 * Once the current task is finished, the async scope ID is reset to
916 * its previous value.
917 *
918 * Must only be called from a running task.
919 *
920 * @param aid the asynchronous scope id to enter
921 */
922void
923GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid);
924
925
926
907#if 0 /* keep Emacsens' auto-indent happy */ 927#if 0 /* keep Emacsens' auto-indent happy */
908{ 928{
909#endif 929#endif