diff options
author | rider <rider@lindenlab.com> | 2015-12-17 09:07:50 -0800 |
---|---|---|
committer | rider <rider@lindenlab.com> | 2015-12-17 09:07:50 -0800 |
commit | db70768def60016daabaf25f38d516d6b72f77ce (patch) | |
tree | 039f0a42f940d03a0e5f365e207ac92956ac17b1 /indra/llcommon/llcoros.cpp | |
parent | 83c9c6df07ab602bdbd2487e587956d0e67993e2 (diff) | |
parent | 6a062089b86c092d6227a64502c4829fc6f0c586 (diff) |
Merge
Diffstat (limited to 'indra/llcommon/llcoros.cpp')
-rwxr-xr-x | indra/llcommon/llcoros.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 548a6d22be..d16bf0160b 100755 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -51,14 +51,32 @@ boost::thread_specific_ptr<LLCoros::CoroData> LLCoros::sCurrentCoro(LLCoros::no_cleanup); //static -LLCoros::coro::self& LLCoros::get_self() +LLCoros::CoroData& LLCoros::get_CoroData(const std::string& caller) { CoroData* current = sCurrentCoro.get(); if (! current) { - LL_ERRS("LLCoros") << "Calling get_self() from non-coroutine context!" << LL_ENDL; + LL_ERRS("LLCoros") << "Calling " << caller << " from non-coroutine context!" << LL_ENDL; } - return *current->mSelf; + return *current; +} + +//static +LLCoros::coro::self& LLCoros::get_self() +{ + return *get_CoroData("get_self()").mSelf; +} + +//static +void LLCoros::set_consuming(bool consuming) +{ + get_CoroData("set_consuming()").mConsuming = consuming; +} + +//static +bool LLCoros::get_consuming() +{ + return get_CoroData("get_consuming()").mConsuming; } llcoro::Suspending::Suspending(): @@ -245,6 +263,8 @@ LLCoros::CoroData::CoroData(CoroData* prev, const std::string& name, // Wrap the caller's callable in our toplevel() function so we can manage // sCurrentCoro appropriately at startup and shutdown of each coroutine. mCoro(boost::bind(toplevel, _1, this, callable), stacksize), + // don't consume events unless specifically directed + mConsuming(false), mSelf(0) { } |