diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2018-11-14 16:17:36 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2018-11-14 16:17:36 -0500 |
commit | f7e99f0db7f9fb52f8001e536f95ec898740631e (patch) | |
tree | 4f6048435c619a14dd0108bb835068098776874d /indra/llcommon/llcoros.h | |
parent | 8558ce5c600b810356010ba3cd6d534ef22f4081 (diff) | |
parent | 4e776c522cb4ba49a5b833d4b9164ab8c48f4b9b (diff) |
Automated merge with ssh://bitbucket.org/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 |