[asterisk-scf-commits] asterisk-scf/release/ice-util-cpp.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Nov 7 09:21:59 CST 2011
branch "master" has been updated
via a86f5428fee250c75f4d4da80d26aebb97f659eb (commit)
from a5df24d0de353dd646b0a8a8d3ee9dc16e369f44 (commit)
Summary of changes:
src/WorkQueue/WorkQueue.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit a86f5428fee250c75f4d4da80d26aebb97f659eb
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Nov 7 11:21:23 2011 -0400
It is unsafe to hold the workqueue lock when calling into the listener upon shutdown since the listener may join the workqueue thread while the workqueue thread is waiting to get the workqueue lock. (issue ASTSCF-318)
diff --git a/src/WorkQueue/WorkQueue.cpp b/src/WorkQueue/WorkQueue.cpp
index a4a9da0..34a022e 100644
--- a/src/WorkQueue/WorkQueue.cpp
+++ b/src/WorkQueue/WorkQueue.cpp
@@ -187,9 +187,11 @@ void WorkQueue::setListener(const QueueListenerPtr& listener)
void WorkQueue::shutdown()
{
- boost::unique_lock<boost::shared_mutex> lock(mPriv->mLock);
- mPriv->checkForShuttingDown();
- mPriv->mShuttingDown = true;
+ {
+ boost::unique_lock<boost::shared_mutex> lock(mPriv->mLock);
+ mPriv->checkForShuttingDown();
+ mPriv->mShuttingDown = true;
+ }
mPriv->mListener->shuttingDown(this);
}
-----------------------------------------------------------------------
--
asterisk-scf/release/ice-util-cpp.git
More information about the asterisk-scf-commits
mailing list