Fix locking bug in ThreadManager.
authorDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:55:04 +0000 (22:55 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:55:04 +0000 (22:55 +0000)
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

lib/cpp/src/concurrency/ThreadManager.cpp

index 604602e..34acc4c 100644 (file)
@@ -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 {