diff options
author | Nicky Dasmijn <nicky.dasmijn@phoenixviewer.com> | 2020-05-19 21:27:16 +0200 |
---|---|---|
committer | Nicky Dasmijn <nicky.dasmijn@phoenixviewer.com> | 2020-05-19 21:27:16 +0200 |
commit | 13b4bd58324e265db5b6d7392f0202c07af1e303 (patch) | |
tree | 888f524c491c1702092c35915f3882bcbce2f4de /indra/llmessage | |
parent | 003ba682a1b7555a41f4c095b927d19c96a77256 (diff) |
Make sure coproc gets destroyed after each iteration.
Making coproc scoped to the for loop will make sure the destructor gets
called every loop iteration. Keeping it's scope outside the for loop
means the pointer keeps valid till the next assigment that happens
inside pop_wait_for when it gets assigned a new value.
Triggering the dtor inside pop_wait_for can lead to deadlock when inside
the dtor a coroutine tries to call enqueueCoprocedure (this happens).
enqueueCoprocedure then will try to grab the lock for try_push but this
lock is still held by pop_wait_for.
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 4168e0c67b..210b83ae2d 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -342,10 +342,10 @@ void LLCoprocedurePool::coprocedureInvokerCoro( CoprocQueuePtr pendingCoprocs, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter) { - QueuedCoproc::ptr_t coproc; - boost::fibers::channel_op_status status; for (;;) { + QueuedCoproc::ptr_t coproc; + boost::fibers::channel_op_status status; { LLCoros::TempStatus st("waiting for work for 10s"); status = pendingCoprocs->pop_wait_for(coproc, std::chrono::seconds(10)); |