diff options
author | dai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-16 19:23:44 +0000 |
---|---|---|
committer | dai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-16 19:23:44 +0000 |
commit | f2bce137508cca9b296f321cf317af457d66e7cd (patch) | |
tree | 2a678894dd86a069f3c5edc7af1541d31b7fb078 | |
parent | db89da1bf5ddd533e08da270b6d4a4a2163c2255 (diff) | |
download | ATCD-f2bce137508cca9b296f321cf317af457d66e7cd.tar.gz |
Thu Mar 16 12:20:41 MST 2006 Yan Dai <dai_y@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 14 | ||||
-rw-r--r-- | TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.h | 6 | ||||
-rw-r--r-- | TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.inl | 4 | ||||
-rw-r--r-- | TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/CSD_ThreadPool/CSD_TP_Task.h | 4 |
5 files changed, 26 insertions, 10 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 9d05d019682..880d127a84c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,17 @@ +Thu Mar 16 12:20:41 MST 2006 Yan Dai <dai_y@ociweb.com> + + * tao/CSD_ThreadPool/CSD_TP_Task.cpp: + * tao/CSD_ThreadPool/CSD_TP_Task.h: + + Typedef'd Thread_Counter as unsigned long and used it for + the num_threads. + + * tao/CSD_ThreadPool/CSD_TP_Strategy.h: + * tao/CSD_ThreadPool/CSD_TP_Strategy.inl: + + Updated data member num_threads_ and set_num_threads() method + to use the Thread_Counter type for the number of threads. + Thu Mar 16 15:48:50 UTC 2006 jiang,shanshan <shanshan.jiang@vanderbilt.edu> * TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.h index fe249cb3e33..2e069caeb6d 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.h @@ -60,14 +60,14 @@ namespace TAO public: /// Constructor. - TP_Strategy(unsigned long num_threads = 1, + TP_Strategy(Thread_Counter num_threads = 1, bool serialize_servants = true); /// Virtual Destructor. virtual ~TP_Strategy(); /// Set the number of threads in the pool (must be > 0). - void set_num_threads(unsigned int num_threads); + void set_num_threads(Thread_Counter num_threads); /// Turn on/off serialization of servants. void set_servant_serialization(bool serialize_servants); @@ -186,7 +186,7 @@ namespace TAO TP_Task task_; /// The number of worker threads to use for the task. - unsigned long num_threads_; + Thread_Counter num_threads_; /// The "serialize servants" flag. bool serialize_servants_; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.inl b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.inl index d0c3e95938b..312484f5c8c 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.inl +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy.inl @@ -5,7 +5,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE -TAO::CSD::TP_Strategy::TP_Strategy(unsigned long num_threads, +TAO::CSD::TP_Strategy::TP_Strategy(Thread_Counter num_threads, bool serialize_servants) : num_threads_(num_threads), serialize_servants_(serialize_servants) @@ -16,7 +16,7 @@ TAO::CSD::TP_Strategy::TP_Strategy(unsigned long num_threads, ACE_INLINE void -TAO::CSD::TP_Strategy::set_num_threads(unsigned int num_threads) +TAO::CSD::TP_Strategy::set_num_threads(Thread_Counter num_threads) { // Simple Mutator. Assumes that num_threads > 0. this->num_threads_ = num_threads; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp index c2411f80125..adc18ab7c7f 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp @@ -51,11 +51,11 @@ TAO::CSD::TP_Task::add_request(TP_Request* request) int TAO::CSD::TP_Task::open(void* num_threads_ptr) { - unsigned num = 1; + Thread_Counter num = 1; if (num_threads_ptr != 0) { - unsigned int* tmp = static_cast<unsigned int*> (num_threads_ptr); + Thread_Counter* tmp = static_cast<Thread_Counter*> (num_threads_ptr); if (tmp == 0) { @@ -73,7 +73,7 @@ TAO::CSD::TP_Task::open(void* num_threads_ptr) { ACE_ERROR_RETURN((LM_ERROR, "(%P|%t) TP_Task failed to open. " - "num_threads_ (%u) is less-than 1.\n", + "num_threads (%u) is less-than 1.\n", num), -1); } @@ -83,7 +83,7 @@ TAO::CSD::TP_Task::open(void* num_threads_ptr) { ACE_ERROR_RETURN((LM_ERROR, "(%P|%t) TP_Task failed to open. " - "num_threads_ (%u) is too large. Max is %d.\n", + "num_threads (%u) is too large. Max is %d.\n", num, MAX_THREADPOOL_TASK_WORKER_THREADS), -1); } diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h index c3192e58cf9..65839aeb3b7 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h @@ -35,6 +35,8 @@ namespace TAO { namespace CSD { + /// Typedef for the number of threads. + typedef unsigned long Thread_Counter; /** * @class TP_Task @@ -137,7 +139,7 @@ namespace TAO bool opened_; /// The number of currently active worker threads. - unsigned num_threads_; + Thread_Counter num_threads_; /// The queue of pending servant requests (a.k.a. the "request queue"). TP_Queue queue_; |