Forgot this one
authorMarc Slemko <marc@apache.org>
Thu, 20 Jul 2006 00:29:35 +0000 (00:29 +0000)
committerMarc Slemko <marc@apache.org>
Thu, 20 Jul 2006 00:29:35 +0000 (00:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664726 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/concurrency/Exception.h [new file with mode: 0644]
lib/cpp/src/concurrency/ThreadManager.cc
lib/cpp/src/concurrency/ThreadManager.h

diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/concurrency/Exception.h
new file mode 100644 (file)
index 0000000..5907f02
--- /dev/null
@@ -0,0 +1,20 @@
+#if !defined(_concurrency_Exception_h_)
+#define _concurrency_Exception_h_ 1
+
+#include <exception>
+
+namespace facebook { namespace thrift { namespace concurrency { 
+
+class NoSuchTaskException : public std::exception {};
+
+class UncancellableTaskException : public std::exception {};
+
+class InvalidArgumentException : public std::exception {};
+
+class IllegalStateException : public std::exception {};
+
+class TimedOutException : public std::exception {};
+
+}}} // facebook::thrift::concurrency
+
+#endif // !defined(_concurrency_Exception_h_)
index f8a5c22..69a96ff 100644 (file)
@@ -414,8 +414,8 @@ ThreadManager* ThreadManager::newThreadManager() {
    return new ThreadManager::Impl();
 }
 
-ThreadManager* ThreadManager::newSimpleThreadManager() {
-   return new SimpleThreadManager();
+ThreadManager* ThreadManager::newSimpleThreadManager(size_t count) {
+   return new SimpleThreadManager(count);
 }
 
 }}} // facebook::thrift::concurrency
index 3b87c21..596471d 100644 (file)
@@ -66,7 +66,9 @@ class ThreadManager {
 
   static ThreadManager* newThreadManager();
 
-  static ThreadManager* newSimpleThreadManager();
+  /** Creates a simple thread manager the uses count number of worker threads */
+
+  static ThreadManager* newSimpleThreadManager(size_t count=4);
 
   class Task;