From: David Reiss Date: Tue, 10 Jun 2008 22:55:04 +0000 (+0000) Subject: Fix locking bug in ThreadManager. X-Git-Tag: 0.2.0~783 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e3a64923e9620ebf99ff51ed5bfcb366e503c79e;p=common%2Fthrift.git Fix locking bug in ThreadManager. It looks like the scheduler waits on monitor_, but the worker notifies workerMonitor_. Also, it does so out of critical section. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666361 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/concurrency/ThreadManager.cpp index 604602e0..34acc4cf 100644 --- a/lib/cpp/src/concurrency/ThreadManager.cpp +++ b/lib/cpp/src/concurrency/ThreadManager.cpp @@ -251,7 +251,7 @@ class ThreadManager::Worker: public Runnable { thread that might be blocked on add. */ if (manager_->pendingTaskCountMax_ != 0 && manager_->tasks_.size() == manager_->pendingTaskCountMax_ - 1) { - manager_->workerMonitor_.notify(); + manager_->monitor_.notify(); } } } else {