summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorMartin Corino <mcorino@remedy.nl>2019-02-19 10:37:48 +0100
committerMartin Corino <mcorino@remedy.nl>2019-02-19 10:37:48 +0100
commit1db52e74003c2395ee6d31a32925bcd8d2169e0f (patch)
treeedd012e59257dd4fbc1e6bb9d7f6dbb4018c707d /ACE
parent3f6b29bb6a22e8515cf95503beda78c52948cf67 (diff)
downloadATCD-1db52e74003c2395ee6d31a32925bcd8d2169e0f.tar.gz
Fix spurious wakeups due to incomplete timepolicy handling.
* ACE/ace/Timer_Queue_Adapters.cpp: * ACE/ace/Timer_Queue_Adapters.h: * ACE/ace/Timer_Queue_T.h:
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ace/Timer_Queue_Adapters.cpp2
-rw-r--r--ACE/ace/Timer_Queue_Adapters.h6
-rw-r--r--ACE/ace/Timer_Queue_T.h3
3 files changed, 10 insertions, 1 deletions
diff --git a/ACE/ace/Timer_Queue_Adapters.cpp b/ACE/ace/Timer_Queue_Adapters.cpp
index b2ccf1a2168..7f12d825813 100644
--- a/ACE/ace/Timer_Queue_Adapters.cpp
+++ b/ACE/ace/Timer_Queue_Adapters.cpp
@@ -159,7 +159,7 @@ ACE_Thread_Timer_Queue_Adapter<TQ, TYPE>::ACE_Thread_Timer_Queue_Adapter (ACE_Th
: ACE_Task_Base (tm),
timer_queue_(timer_queue),
delete_timer_queue_(false),
- condition_ (mutex_),
+ condition_ (mutex_, cond_attr_),
active_ (true), // Assume that we start in active mode.
thr_id_ (ACE_OS::NULL_thread)
{
diff --git a/ACE/ace/Timer_Queue_Adapters.h b/ACE/ace/Timer_Queue_Adapters.h
index f7648a9df5b..8f9ff61f20f 100644
--- a/ACE/ace/Timer_Queue_Adapters.h
+++ b/ACE/ace/Timer_Queue_Adapters.h
@@ -225,6 +225,12 @@ private:
/// <condition_>.
ACE_SYNCH_RECURSIVE_MUTEX mutex_;
+ /// Attributes to initialize condition with.
+ /* We only need this because some crappy compilers can't
+ properly handle initializing the conditions with
+ temporary objects. */
+ ACE_Condition_Attributes_T<TQ::time_policy_t> cond_attr_;
+
/**
* The dispatching thread sleeps on this condition while waiting to
* dispatch the next timer; it is used to wake it up if there is a
diff --git a/ACE/ace/Timer_Queue_T.h b/ACE/ace/Timer_Queue_T.h
index 6537488fb43..d2f15add2b9 100644
--- a/ACE/ace/Timer_Queue_T.h
+++ b/ACE/ace/Timer_Queue_T.h
@@ -73,6 +73,9 @@ class ACE_Timer_Queue_T
: public ACE_Timer_Queue_Upcall_Base<TYPE,FUNCTOR>
{
public:
+ /// Type of time policy
+ typedef TIME_POLICY time_policy_t;
+
// = Initialization and termination methods.
/**
* Default constructor. @a upcall_functor is the instance of the