diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-03-01 02:24:00 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-03-01 02:24:00 +0200 |
commit | 36cb6933e6c1ad92e1887503b74a05c32988b0f1 (patch) | |
tree | 80739997a9b1e00f93af4e273058ab52a761e36a /indra/llcommon/llcoros.h | |
parent | 599e08181544f214142703928a6d242a0ae72e60 (diff) | |
parent | 03db2ddc9c27cf842c6185826617b0da0d2b87f5 (diff) |
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon/llcoros.h')
-rw-r--r-- | indra/llcommon/llcoros.h | 20 |
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 |