diff options
Diffstat (limited to 'orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp')
-rw-r--r-- | orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp b/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp index f9969b33d6a..b14c5612c23 100644 --- a/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp +++ b/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp @@ -1,3 +1,5 @@ +// $Id$ + #include "orbsvcs/LoadBalancing/LB_LeastLoaded.h" #include "orbsvcs/LoadBalancing/LB_LoadMap.h" #include "orbsvcs/LoadBalancing/LB_Random.h" @@ -10,12 +12,6 @@ #include "ace/Null_Mutex.h" #include "ace/OS_NS_string.h" - -ACE_RCSID (LoadBalancing, - LB_LeastLoaded, - "$Id$") - - #if !defined (__ACE_INLINE__) #include "orbsvcs/LoadBalancing/LB_LeastLoaded.inl" #endif /* defined INLINE */ @@ -35,7 +31,7 @@ TAO_LB_LeastLoaded::TAO_LB_LeastLoaded (PortableServer::POA_ptr poa) { // A load map that retains previous load values at a given location // and lock are only needed if dampening is enabled, i.e. non-zero. - if (this->dampening_ != 0) + if (!ACE::is_equal (this->dampening_, 0.0f)) { ACE_NEW (this->load_map_, TAO_LB_LoadMap (TAO_PG_MAX_LOCATIONS)); @@ -262,7 +258,7 @@ TAO_LB_LeastLoaded::analyze_loads ( */ // Perform load rebalancing only if the critical threshold // was set. - if (this->critical_threshold_ != 0) + if (!ACE::is_equal (this->critical_threshold_, 0.0f)) { if (load.value > this->critical_threshold_) { @@ -349,7 +345,7 @@ TAO_LB_LeastLoaded::get_location ( load.value, min_load)); */ - if ((this->reject_threshold_ == 0 + if ((ACE::is_equal (this->reject_threshold_, 0.0f) || load.value < this->reject_threshold_) && load.value < min_load) { @@ -357,7 +353,7 @@ TAO_LB_LeastLoaded::get_location ( // "**** LOAD == %f\n", // load.value)); - if (i > 0 && load.value != 0) + if (i > 0 && !ACE::is_equal (load.value, 0.0f)) { /* percent difference = @@ -468,7 +464,7 @@ TAO_LB_LeastLoaded::get_location ( //ACE_DEBUG ((LM_DEBUG, "LOCATED = %u\n", location_index)); location = locations[location_index]; } - else if (this->reject_threshold_ != 0) + else if (!ACE::is_equal (this->reject_threshold_, 0.0f)) throw CORBA::TRANSIENT (); // ACE_DEBUG ((LM_DEBUG, "LOCATION ID == %s\n", location[0].id.in ())); @@ -539,7 +535,8 @@ TAO_LB_LeastLoaded::init (const PortableGroup::Properties & props) } } - if (critical_threshold != 0 && reject_threshold != 0 + if (!ACE::is_equal (critical_threshold, 0.0f) + && !ACE::is_equal (reject_threshold, 0.0f) && critical_threshold <= reject_threshold) throw PortableGroup::InvalidProperty (ct->nam, ct->val); |