From af5ed67002b7031e1735968674bacb5ee868165f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 30 Aug 2019 16:03:07 +0200 Subject: Cutoff diagnostics stack when switching to nested context --- libbuild2/context.hxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libbuild2/context.hxx') 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 { -- cgit v1.1