From 525c202df48b8154c0a8b6b8d86ee825e9ae8944 Mon Sep 17 00:00:00 2001 From: Marc Slemko Date: Thu, 20 Jul 2006 00:29:35 +0000 Subject: [PATCH] Forgot this one git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664726 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/src/concurrency/Exception.h | 20 ++++++++++++++++++++ lib/cpp/src/concurrency/ThreadManager.cc | 4 ++-- lib/cpp/src/concurrency/ThreadManager.h | 4 +++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 lib/cpp/src/concurrency/Exception.h diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/concurrency/Exception.h new file mode 100644 index 00000000..5907f028 --- /dev/null +++ b/lib/cpp/src/concurrency/Exception.h @@ -0,0 +1,20 @@ +#if !defined(_concurrency_Exception_h_) +#define _concurrency_Exception_h_ 1 + +#include + +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_) diff --git a/lib/cpp/src/concurrency/ThreadManager.cc b/lib/cpp/src/concurrency/ThreadManager.cc index f8a5c224..69a96ff8 100644 --- a/lib/cpp/src/concurrency/ThreadManager.cc +++ b/lib/cpp/src/concurrency/ThreadManager.cc @@ -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 diff --git a/lib/cpp/src/concurrency/ThreadManager.h b/lib/cpp/src/concurrency/ThreadManager.h index 3b87c214..596471d4 100644 --- a/lib/cpp/src/concurrency/ThreadManager.h +++ b/lib/cpp/src/concurrency/ThreadManager.h @@ -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; -- 2.17.1