From cef1d13d2e3ff43857bc32dfb657f7bacbc844bb Mon Sep 17 00:00:00 2001 From: irfan Date: Wed, 12 Sep 2001 01:36:28 +0000 Subject: Minor change --- TAO/tao/RTCORBA/Thread_Pool.cpp | 10 +++++++++- TAO/threadpool-changes | 11 +++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index 8c828648571..aba3f630f2d 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -25,7 +25,15 @@ TAO_RT_New_Leader_Generator::TAO_RT_New_Leader_Generator (TAO_Thread_Lane &lane) void TAO_RT_New_Leader_Generator::no_leaders_available (void) { - if (this->lane_.dynamic_threads () == 0) + // Note that we are checking this condition below without the lock + // held. The value of and does + // not change, but increases when new dynamic + // threads are created. Even if we catch in an + // inconsistent state, we will double check later with the lock + // held. Therefore, this check should not cause any big problems. + if (this->lane_.current_threads () == + this->lane_.static_threads () + + this->lane_.dynamic_threads ()) return; TAO_Thread_Pool_Manager &manager = diff --git a/TAO/threadpool-changes b/TAO/threadpool-changes index e27829feaed..8d60d7bdcca 100644 --- a/TAO/threadpool-changes +++ b/TAO/threadpool-changes @@ -247,12 +247,11 @@ Fri Aug 24 18:08:37 2001 Irfan Pyarali method is called by the leader followers class when it is out of threads to run the event loop. - If this lane has support for dynamic threads, we grab the - Thread Pool Manager lock, check if the current number of - threads in this lane does not exceed the + - number of threads specified by the user. If it - does not exceed + , one dynamic thread - is created. + We grab the Thread Pool Manager lock, check if the current + number of threads in this lane does not exceed the + + number of threads specified by the + user. If it does not exceed + , one + dynamic thread is created. * tao/RTCORBA/RT_Protocols_Hooks.cpp (set_default_server_protocol_policy): Don't include all the -- cgit v1.2.1