aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-30 16:03:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-30 16:03:07 +0200
commitaf5ed67002b7031e1735968674bacb5ee868165f (patch)
tree7cb6d0101168c58ebb2247e3ec79b33f816e8b1e /libbuild2/context.hxx
parent7c426821e7fb4919e84ec20bd2f88481db665e90 (diff)
Cutoff diagnostics stack when switching to nested context
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index c2c191e..d2e38e7 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -102,9 +102,18 @@ namespace build2
// @@ CTX: document (backlinks, non-overlap etc). RW story.
//
// A context can be preempted to execute another context (we do this, for
- // example, to update build system modules).
+ // example, to update build system modules). When switching to such a nested
+ // context you may want to cutoff the diagnostics stack (and maybe insert
+ // your own entry), for example:
//
- // @@ Progress could clash.
+ // diag_frame::stack_guard diag_cutoff (nullptr);
+ //
+ // As well as suppress progress which would otherwise clash (maybe in the
+ // future we can do save/restore but then we would need some indication that
+ // we have switched to another task).
+ //
+ // Note also that any given thread should not participate in multiple
+ // schedulers at the same time (see scheduler::join/leave() for details).
//
class LIBBUILD2_SYMEXPORT context
{