r430@peterm-macbook (orig r44187): marc | 2007-05-22 16:59:54 -0700
commit27b08ed159363635bbbba257fe4654699f69d221
author(no author) <(no author)@41a61cd8-c433-0410-bb1c-e256eeef9e11>
Sun, 8 Jul 2007 07:13:08 +0000 (8 07:13 +0000)
committer(no author) <(no author)@41a61cd8-c433-0410-bb1c-e256eeef9e11>
Sun, 8 Jul 2007 07:13:08 +0000 (8 07:13 +0000)
tree29323271baac636f92f9b5676360eb522d201423
parenta6c7048062b709aefb7fee6a0bc9d2620baf1733
 r430@peterm-macbook (orig r44187):  marc | 2007-05-22 16:59:54 -0700
 Modified facebook::thrift::concurrency::Monitor.wait:
         Throw TimedOutException on wait timeout so caller can distinguish between timeout and event.

 Modified facebook::thrift::concurrency::PthreadThread.start:
         Throw SystemrResourceException on any pthread_* function call failure rather than asserting 0.

 Added facebook::thrift::concurrency::Thread.id() and  facebook::thrift::concurrency::ThreadFactory.currentThreadId():
         Return thread-id of thread and current thread respectively.  Needed for reentrancy tests in ThreadManager

 Added facebook::thrift::concurrency::ThreadManager.pendingTaskCountMaxN
 Modified facebook::thrift::concurrency::ThreadManager.add():
         Now support a maximum pending task count and block if the current pending task count is max.
         If timeout is specified for add, TimedOutException is thrown if pending task count doesn't decrease
         in the timeout interval.  If add() is called by a ThreadManager worker thread and the task cannot
         be added, a TooManyPendingTasksException is thrown rather than blocking, since deadlocks can ensue
         if worker threads block waiting for works threads to complete tasks.

 Reviewed By: mcslee, aditya

 Revert Plan: revertible

 Test Plan: concurrency/test/ThreadManagerTests.h
            run concurrency-test thread-manager

git-svn-id: http://svn.facebook.com/svnroot/thrift/trunk@435 41a61cd8-c433-0410-bb1c-e256eeef9e11
15 files changed:
lib/cpp/src/concurrency/Exception.h
lib/cpp/src/concurrency/Monitor.cpp
lib/cpp/src/concurrency/Monitor.h
lib/cpp/src/concurrency/PosixThreadFactory.cpp
lib/cpp/src/concurrency/PosixThreadFactory.h
lib/cpp/src/concurrency/Thread.h
lib/cpp/src/concurrency/ThreadManager.cpp
lib/cpp/src/concurrency/ThreadManager.h
lib/cpp/src/concurrency/TimerManager.cpp
lib/cpp/src/concurrency/test/Tests.cpp
lib/cpp/src/concurrency/test/ThreadFactoryTests.h
lib/cpp/src/concurrency/test/ThreadManagerTests.h
lib/cpp/src/server/TThreadPoolServer.cpp
lib/cpp/src/server/TThreadPoolServer.h
test/threads/ThreadsServer.cpp