summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ChangeLog11
-rw-r--r--ACE/ace/Message_Queue_T.cpp4
-rw-r--r--ACE/ace/Message_Queue_T.h11
-rw-r--r--ACE/ace/Stream.cpp2
-rw-r--r--ACE/ace/Stream.h11
-rw-r--r--ACE/tests/Bug_4055_Regression_Test.cpp3
-rw-r--r--ACE/tests/Monotonic_Task_Test.cpp5
7 files changed, 41 insertions, 6 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 64366b0f6e3..7a16e4e6a05 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,14 @@
+Fri Aug 17 09:04:50 UTC 2012 Martin Corino <mcorino@remedy.nl>
+
+ * ace/Message_Queue_T.h:
+ * ace/Message_Queue_T.cpp:
+ * ace/Stream.h:
+ * ace/Stream.cpp:
+ * tests/Bug_4055_Regression_Test.cpp:
+ * tests/Monotonic_Task_Test.cpp:
+ Fixed compile errors for a bunch of crappy compilers
+ like the one on RHEL53 and AIX.
+
Thu Aug 16 18:47:59 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/ace.mpc:
diff --git a/ACE/ace/Message_Queue_T.cpp b/ACE/ace/Message_Queue_T.cpp
index ee9d08bdace..ffb66781a45 100644
--- a/ACE/ace/Message_Queue_T.cpp
+++ b/ACE/ace/Message_Queue_T.cpp
@@ -1046,8 +1046,8 @@ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY>::ACE_Message_Queue (size_t hwm,
size_t lwm,
ACE_Notification_Strategy *ns)
#if defined (ACE_HAS_THREADS)
- : not_empty_cond_ (lock_, ACE_Condition_Attributes_T<TIME_POLICY> ())
- , not_full_cond_ (lock_, ACE_Condition_Attributes_T<TIME_POLICY> ())
+ : not_empty_cond_ (lock_, cond_attr_)
+ , not_full_cond_ (lock_, cond_attr_)
#else
: not_empty_cond_ (lock_)
, not_full_cond_ (lock_)
diff --git a/ACE/ace/Message_Queue_T.h b/ACE/ace/Message_Queue_T.h
index 8e244f7a072..51431c6e6c7 100644
--- a/ACE/ace/Message_Queue_T.h
+++ b/ACE/ace/Message_Queue_T.h
@@ -21,6 +21,9 @@
#include "ace/Guard_T.h"
#include "ace/Time_Policy.h"
#include "ace/Time_Value_T.h"
+#if defined (ACE_HAS_THREADS)
+# include "ace/Condition_Attributes.h"
+#endif
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -606,6 +609,14 @@ protected:
/// Protect queue from concurrent access.
ACE_SYNCH_MUTEX_T lock_;
+#if defined (ACE_HAS_THREADS)
+ /// Attributes to initialize conditions with.
+ /* We only need this because some crappy compilers can't
+ properly handle initializing the conditions with
+ temporary objects. */
+ ACE_Condition_Attributes_T<TIME_POLICY> cond_attr_;
+#endif
+
/// Used to make threads sleep until the queue is no longer empty.
ACE_SYNCH_CONDITION_T not_empty_cond_;
diff --git a/ACE/ace/Stream.cpp b/ACE/ace/Stream.cpp
index fc0a4d870c3..baea01f1fac 100644
--- a/ACE/ace/Stream.cpp
+++ b/ACE/ace/Stream.cpp
@@ -605,7 +605,7 @@ ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>::ACE_Stream (void * a,
stream_tail_ (0),
linked_us_ (0),
#if defined (ACE_HAS_THREADS)
- final_close_ (lock_, ACE_Condition_Attributes_T<TIME_POLICY> ())
+ final_close_ (lock_, cond_attr_)
#else
final_close_ (lock_)
#endif
diff --git a/ACE/ace/Stream.h b/ACE/ace/Stream.h
index 5d72a377074..2fe058474bb 100644
--- a/ACE/ace/Stream.h
+++ b/ACE/ace/Stream.h
@@ -24,6 +24,9 @@
#include "ace/IO_Cntl_Msg.h"
#include "ace/Message_Block.h"
#include "ace/Module.h"
+#if defined (ACE_HAS_THREADS)
+# include "ace/Condition_Attributes.h"
+#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -188,6 +191,14 @@ private:
/// Protect the stream against race conditions.
ACE_SYNCH_MUTEX_T lock_;
+#if defined (ACE_HAS_THREADS)
+ /// 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<TIME_POLICY> cond_attr_;
+#endif
+
/// Use to tell all threads waiting on the close that we are done.
ACE_SYNCH_CONDITION_T final_close_;
};
diff --git a/ACE/tests/Bug_4055_Regression_Test.cpp b/ACE/tests/Bug_4055_Regression_Test.cpp
index e462934a5bc..13760e1e448 100644
--- a/ACE/tests/Bug_4055_Regression_Test.cpp
+++ b/ACE/tests/Bug_4055_Regression_Test.cpp
@@ -325,7 +325,8 @@ run_main (int , ACE_TCHAR *[])
ACE_Thread_Mutex mutex_;
ACE_Condition_Thread_Mutex condition_ (mutex_);
- ACE_Condition_Thread_Mutex monotonic_condition_ (mutex_, ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> ());
+ ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> monotonic_cond_attr_;
+ ACE_Condition_Thread_Mutex monotonic_condition_ (mutex_, monotonic_cond_attr_);
if (mutex_.acquire () != 0)
{
diff --git a/ACE/tests/Monotonic_Task_Test.cpp b/ACE/tests/Monotonic_Task_Test.cpp
index 0e004c260a8..79405c79daf 100644
--- a/ACE/tests/Monotonic_Task_Test.cpp
+++ b/ACE/tests/Monotonic_Task_Test.cpp
@@ -75,8 +75,8 @@ class MyTask : public ACE_Task<ACE_MT_SYNCH, ACE_Monotonic_Time_Policy>
public:
MyTask ()
: stop_ (false),
- tm_ (ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> ()),
- cond_ (lock_, ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> ()),
+ tm_ (monotonic_cond_attr_),
+ cond_ (lock_, monotonic_cond_attr_),
status_ (0)
{
// set monotonic timer aware thread manager for this task
@@ -97,6 +97,7 @@ public:
private:
bool stop_;
+ ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> monotonic_cond_attr_;
ACE_Thread_Manager tm_;
ACE_Thread_Mutex lock_;
ACE_Condition<ACE_Thread_Mutex> cond_;