summaryrefslogtreecommitdiff
path: root/indra/llcommon/llcoros.h
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-03-01 02:28:15 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-03-01 02:28:15 +0200
commit27e197459da275d2cd8847aa36e6c6bc4720e5c5 (patch)
treefccc0ceaac90e03939d37e54cb8519a0132993cf /indra/llcommon/llcoros.h
parent1a1465dab94a2829cedb4ee4cd0c0169cea0fdeb (diff)
parent2ab914a9cdd1ad809879aca05dbf4b624949ecea (diff)
Merge
Diffstat (limited to 'indra/llcommon/llcoros.h')
-rw-r--r--indra/llcommon/llcoros.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h
index 8fb27af6a4..c551413811 100644
--- a/indra/llcommon/llcoros.h
+++ b/indra/llcommon/llcoros.h
@@ -170,6 +170,26 @@ public:
static bool get_consuming();
/**
+ * RAII control of the consuming flag
+ */
+ class OverrideConsuming
+ {
+ public:
+ OverrideConsuming(bool consuming):
+ mPrevConsuming(get_consuming())
+ {
+ set_consuming(consuming);
+ }
+ ~OverrideConsuming()
+ {
+ set_consuming(mPrevConsuming);
+ }
+
+ private:
+ bool mPrevConsuming;
+ };
+
+ /**
* Please do NOT directly use boost::dcoroutines::future! It is essential
* to maintain the "current" coroutine at every context switch. This
* Future wraps the essential boost::dcoroutines::future functionality