From 85d4a4f5eda5f849e4099f7e0229fad88e74a70c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 19 Aug 2018 20:10:51 -0700 Subject: [PATCH] ircd::ctx: Further tweak interruption masking semantics. --- ircd/ctx.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ircd/ctx.cc b/ircd/ctx.cc index c55e8a77c..09e16e0e6 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -577,8 +577,18 @@ ircd::ctx::this_ctx::stack_at_here() void ircd::ctx::this_ctx::interruptible(const bool &b) { + const bool theirs + { + interruptible(cur()) + }; + + if(theirs && !b) + interruption_point(); + interruptible(cur(), b); - interruption_point(); + + if(!theirs && b) + interruption_point(); } /// Throws interrupted if the currently running context was interrupted @@ -1023,7 +1033,6 @@ ircd::ctx::pool::del(const size_t &num) size_t(std::max(requested, 0L)) }; - const uninterruptible ui; while(ctxs.size() > target) ctxs.pop_back(); }