diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-03-31 08:06:06 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-03-31 08:06:06 +0000 |
commit | 1e490789a3436cc5e24385ff9247c27179650421 (patch) | |
tree | 9d5190b53a0e5b7fc721b119d9c9a81626af6cc5 | |
parent | be1009a87fabc8f42496485ffa923dac55709e41 (diff) | |
download | ATCD-1e490789a3436cc5e24385ff9247c27179650421.tar.gz |
ChangeLogTag: Wed Mar 31 09:05:32 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ace/Select_Reactor_T.cpp | 2 | ||||
-rw-r--r-- | ace/Select_Reactor_T.i | 2 | ||||
-rw-r--r-- | ace/Time_Value.cpp | 16 | ||||
-rw-r--r-- | ace/Time_Value.h | 16 | ||||
-rw-r--r-- | ace/Timer_Hash_T.cpp | 4 | ||||
-rw-r--r-- | ace/Timer_List_T.cpp | 2 | ||||
-rw-r--r-- | ace/Timer_Queue_Adapters.cpp | 2 | ||||
-rw-r--r-- | ace/Timer_Queue_Adapters.h | 4 | ||||
-rw-r--r-- | ace/Timer_Queue_T.cpp | 6 | ||||
-rw-r--r-- | ace/Timer_Queue_T.h | 2 | ||||
-rw-r--r-- | ace/Timer_Queue_T.i | 2 | ||||
-rw-r--r-- | ace/Timer_Wheel_T.cpp | 12 |
12 files changed, 27 insertions, 43 deletions
diff --git a/ace/Select_Reactor_T.cpp b/ace/Select_Reactor_T.cpp index fb45bd3a527..61214c16d06 100644 --- a/ace/Select_Reactor_T.cpp +++ b/ace/Select_Reactor_T.cpp @@ -1460,7 +1460,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::check_handles (void) ACE_TRACE ("ACE_Select_Reactor_T::check_handles"); #if defined (ACE_WIN32) || defined (__MVS__) || defined (ACE_PSOS) || defined (VXWORKS) - ACE_Time_Value time_poll = ACE_Time_Value::zero_time_value(); + ACE_Time_Value time_poll = ACE_Time_Value::zero; ACE_Handle_Set rd_mask; #endif /* ACE_WIN32 || MVS || ACE_PSOS || VXWORKS */ diff --git a/ace/Select_Reactor_T.i b/ace/Select_Reactor_T.i index 2d39fa0e705..f82fdce2974 100644 --- a/ace/Select_Reactor_T.i +++ b/ace/Select_Reactor_T.i @@ -184,7 +184,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::wakeup_all_threads (void) { // Send a notification, but don't block if there's no one to receive // it. - this->notify (0, ACE_Event_Handler::NULL_MASK, (ACE_Time_Value *) &ACE_Time_Value::zero_time_value()); + this->notify (0, ACE_Event_Handler::NULL_MASK, (ACE_Time_Value *) &ACE_Time_Value::zero); } template <class ACE_SELECT_REACTOR_TOKEN> /* ACE_INLINE */ int diff --git a/ace/Time_Value.cpp b/ace/Time_Value.cpp index 1623a6c1dd0..603fe34ea17 100644 --- a/ace/Time_Value.cpp +++ b/ace/Time_Value.cpp @@ -16,14 +16,6 @@ ACE_RCSID (ace, // Note: this object requires static construction. const ACE_Time_Value ACE_Time_Value::zero; -// Accessor method for zero for exported use (since some compilers, -// i.e. MingW, have trouble handling exported class data members). -const ACE_Time_Value& -ACE_Time_Value::zero_time_value (void) -{ - return zero; -} - // Constant for maximum time representable. Note that this time // is not intended for use with select () or other calls that may // have *their own* implementation-specific maximum time representations. @@ -33,14 +25,6 @@ ACE_Time_Value::zero_time_value (void) const ACE_Time_Value ACE_Time_Value::max_time (LONG_MAX, ACE_ONE_SECOND_IN_USECS - 1); -// Accessor method for max_time for exported use (since some compilers, -// i.e. MingW, have trouble handling exported class data members). -const ACE_Time_Value& -ACE_Time_Value::max_time_value (void) -{ - return max_time; -} - ACE_ALLOC_HOOK_DEFINE (ACE_Time_Value) // Increment microseconds (the only reason this is here is to allow diff --git a/ace/Time_Value.h b/ace/Time_Value.h index d05638245b5..59ea5ed931f 100644 --- a/ace/Time_Value.h +++ b/ace/Time_Value.h @@ -99,10 +99,6 @@ public: /// Constant "0". static const ACE_Time_Value zero; - /// Accessor method for zero for exported use (since some compilers, - /// i.e. MingW, have trouble handling exported class data members). - static const ACE_Time_Value& zero_time_value (void); - /** * Constant for maximum time representable. Note that this time is * not intended for use with <select> or other calls that may have @@ -113,10 +109,6 @@ public: */ static const ACE_Time_Value max_time; - /// Accessor method for max_time for exported use (since some compilers, - /// i.e. MingW, have trouble handling exported class data members). - static const ACE_Time_Value& max_time_value (void); - // = Initialization methods. /// Default Constructor. @@ -369,6 +361,14 @@ private: #include "ace/Time_Value.inl" #endif /* __ACE_INLINE__ */ +#if defined (__MINGW32__) +// The MingW linker has problems with the exported statics zero and max_time +// with these two statics the linker will be able to resolve the static +// exported symbols. +static const ACE_Time_Value& __zero_time = ACE_Time_Value::zero; +static const ACE_Time_Value& __max_time = ACE_Time_Value::max_time; +#endif /* __MINGW32__ */ + #include /**/ "ace/post.h" #endif /* ACE_TIME_VALUE_H */ diff --git a/ace/Timer_Hash_T.cpp b/ace/Timer_Hash_T.cpp index 9f8aaed7575..0f5450cabc2 100644 --- a/ace/Timer_Hash_T.cpp +++ b/ace/Timer_Hash_T.cpp @@ -665,7 +665,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::find_new_earliest (void) for (size_t i = 0; i < this->table_size_; i++) if (!this->table_[i]->is_empty ()) if (this->table_[this->earliest_position_]->is_empty () - || this->earliest_time () == ACE_Time_Value::zero_time_value() + || this->earliest_time () == ACE_Time_Value::zero || this->table_[i]->earliest_time () <= this->earliest_time ()) this->earliest_position_ = i; } @@ -753,7 +753,7 @@ ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>::expire (const ACE_Time_Value #endif // Check if this is an interval timer. - if (expired->get_interval () > ACE_Time_Value::zero_time_value()) + if (expired->get_interval () > ACE_Time_Value::zero) { // Make sure that we skip past values that have already // "expired". diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp index 0858993fbf5..164e1aecb07 100644 --- a/ace/Timer_List_T.cpp +++ b/ace/Timer_List_T.cpp @@ -113,7 +113,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const ACE_Timer_Node_T<TYPE>* first = this->get_first_i(); if (first != 0) return first->get_timer_value (); - return ACE_Time_Value::zero_time_value(); + return ACE_Time_Value::zero; } diff --git a/ace/Timer_Queue_Adapters.cpp b/ace/Timer_Queue_Adapters.cpp index b993176515d..98078030f5a 100644 --- a/ace/Timer_Queue_Adapters.cpp +++ b/ace/Timer_Queue_Adapters.cpp @@ -53,7 +53,7 @@ ACE_Async_Timer_Queue_Adapter<TQ>::schedule_ualarm (void) // Beware of negative times and zero times (which cause problems for // <ualarm>). - if (tv < ACE_Time_Value::zero_time_value()) + if (tv < ACE_Time_Value::zero) tv = ACE_Time_Value (0, 1); // @@ This code should be clever enough to avoid updating the diff --git a/ace/Timer_Queue_Adapters.h b/ace/Timer_Queue_Adapters.h index 39899a5c096..1caead77c9d 100644 --- a/ace/Timer_Queue_Adapters.h +++ b/ace/Timer_Queue_Adapters.h @@ -56,7 +56,7 @@ public: long schedule (ACE_Event_Handler *type, const void *act, const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero_time_value()); + const ACE_Time_Value &interval = ACE_Time_Value::zero); /// Cancel the @a timer_id and pass back the @a act if an address is /// passed in. @@ -131,7 +131,7 @@ public: long schedule (ACE_Event_Handler *handler, const void *act, const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero_time_value()); + const ACE_Time_Value &interval = ACE_Time_Value::zero); /// Cancel the <timer_id> and return the <act> parameter if an /// address is passed in. Also wakes up the dispatching thread. diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp index 7947dcb145a..308f33ebecc 100644 --- a/ace/Timer_Queue_T.cpp +++ b/ace/Timer_Queue_T.cpp @@ -101,7 +101,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m // The earliest item on the Timer_Queue is now in the past. // Therefore, we've got to "poll" the Reactor, i.e., it must // just check the descriptors and then dispatch timers, etc. - this->timeout_ = ACE_Time_Value::zero_time_value(); + this->timeout_ = ACE_Time_Value::zero; return &this->timeout_; } } @@ -144,7 +144,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::calculate_timeout (ACE_Time_Value *m // The earliest item on the Timer_Queue is now in the past. // Therefore, we've got to "poll" the Reactor, i.e., it must // just check the descriptors and then dispatch timers, etc. - *the_timeout = ACE_Time_Value::zero_time_value(); + *the_timeout = ACE_Time_Value::zero; } } return the_timeout; @@ -301,7 +301,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info_i (const ACE_Time_Valu expired->get_dispatch_info (info); // Check if this is an interval timer. - if (expired->get_interval () > ACE_Time_Value::zero_time_value()) + if (expired->get_interval () > ACE_Time_Value::zero) { // Make sure that we skip past values that have already // "expired". diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h index 788d6990506..5f103313135 100644 --- a/ace/Timer_Queue_T.h +++ b/ace/Timer_Queue_T.h @@ -247,7 +247,7 @@ public: virtual long schedule (const TYPE &type, const void *act, const ACE_Time_Value &future_time, - const ACE_Time_Value &interval = ACE_Time_Value::zero_time_value()); + const ACE_Time_Value &interval = ACE_Time_Value::zero); /** * Resets the interval of the timer represented by <timer_id> to diff --git a/ace/Timer_Queue_T.i b/ace/Timer_Queue_T.i index 368f5a053d9..a4af07d5372 100644 --- a/ace/Timer_Queue_T.i +++ b/ace/Timer_Queue_T.i @@ -127,7 +127,7 @@ ACE_Timer_Node_T<TYPE>::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T<TYPE> info.type_ = this->type_; info.act_ = this->act_; info.recurring_timer_ = - this->interval_ > ACE_Time_Value::zero_time_value(); + this->interval_ > ACE_Time_Value::zero; } template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp index 818cdb52ba0..a0283267579 100644 --- a/ace/Timer_Wheel_T.cpp +++ b/ace/Timer_Wheel_T.cpp @@ -157,7 +157,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::open_i for (u_int i = 0; i < this->spoke_count_; ++i) { ACE_Timer_Node_T<TYPE>* root = this->alloc_node (); - root->set (0, 0, ACE_Time_Value::zero_time_value(), ACE_Time_Value::zero_time_value(), root, root, 0); + root->set (0, 0, ACE_Time_Value::zero, ACE_Time_Value::zero, root, root, 0); this->spokes_[i] = root; } @@ -263,7 +263,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const ACE_Timer_Node_T<TYPE>* n = this->get_first_i (); if (n != 0) return n->get_timer_value (); - return ACE_Time_Value::zero_time_value(); + return ACE_Time_Value::zero; } /// Uses a simple hash to find which spoke to use based on when the @@ -652,7 +652,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::recalc_earliest if (this->is_empty ()) return; - ACE_Time_Value et = ACE_Time_Value::zero_time_value(); + ACE_Time_Value et = ACE_Time_Value::zero; u_int spoke = this->earliest_spoke_; @@ -669,7 +669,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::recalc_earliest this->earliest_spoke_ = spoke; return; } - else if (et == ACE_Time_Value::zero_time_value() || t < et) + else if (et == ACE_Time_Value::zero || t < et) { et = t; } @@ -724,7 +724,7 @@ template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> * ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void) { ACE_TRACE ("ACE_Timer_Wheel_T::remove_first"); - return remove_first_expired (ACE_Time_Value::max_time_value()); + return remove_first_expired (ACE_Time_Value::max_time); } template <class TYPE, class FUNCTOR, class ACE_LOCK> void @@ -833,7 +833,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire (const ACE_Time_Value& cur_ti this->postinvoke (info, cur_time, upcall_act); - if (n->get_interval () > ACE_Time_Value::zero_time_value()) + if (n->get_interval () > ACE_Time_Value::zero) { // Make sure that we skip past values that have already // "expired". |