diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-04 15:40:30 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-04 15:40:30 -0400 |
commit | 7a5b92199598be0fc5a2702d071afda06e6ae59f (patch) | |
tree | 989dbe8554b42f6c06038b01de1ea9686ab42434 /indra/llcommon/workqueue.cpp | |
parent | 3faba7515c757ca3183522bd017c0f76d9c4581c (diff) | |
parent | 8b16ecb9cfb4917fe38e4e5b0e4f40a23dd4ffbf (diff) |
SL-16202: Merge branch 'sl-16220' into glthread
Diffstat (limited to 'indra/llcommon/workqueue.cpp')
-rw-r--r-- | indra/llcommon/workqueue.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp index b32357e832..9808757b0a 100644 --- a/indra/llcommon/workqueue.cpp +++ b/indra/llcommon/workqueue.cpp @@ -38,6 +38,16 @@ void LL::WorkQueue::close() mQueue.close(); } +bool LL::WorkQueue::isClosed() +{ + return mQueue.isClosed(); +} + +bool LL::WorkQueue::done() +{ + return mQueue.done(); +} + void LL::WorkQueue::runUntilClose() { try @@ -128,3 +138,13 @@ void LL::WorkQueue::error(const std::string& msg) { LL_ERRS("WorkQueue") << msg << LL_ENDL; } + +void LL::WorkQueue::checkCoroutine(const std::string& method) +{ + // By convention, the default coroutine on each thread has an empty name + // string. See also LLCoros::logname(). + if (LLCoros::getName().empty()) + { + LLTHROW(Error("Do not call " + method + " from a thread's default coroutine")); + } +} |