summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-22 07:37:41 +0000
committergonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-22 07:37:41 +0000
commitf078bbbfd4cd9e430eb7a2d69d50ed146f343c1d (patch)
treec46bb3307f040375d36428e9be7ae86f54cd5878
parent2d7a7c9bdd96fda2e35f9501ce7224bf3cb17061 (diff)
downloadATCD-f078bbbfd4cd9e430eb7a2d69d50ed146f343c1d.tar.gz
Changes on Thread_Manager for Borland compilers
-rw-r--r--ChangeLog-98b13
-rw-r--r--ace/OS.cpp4
-rw-r--r--ace/Thread_Manager.cpp30
-rw-r--r--ace/Thread_Manager.h21
-rw-r--r--ace/Thread_Manager.i16
5 files changed, 49 insertions, 35 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b
index 559896f167d..236cd71763c 100644
--- a/ChangeLog-98b
+++ b/ChangeLog-98b
@@ -1,3 +1,16 @@
+Mon Jun 22 02:32:56 1998 Gonzalo Diethelm <gonzo@tango.cs.wustl.edu>
+
+ * ace/Thread_Manager.h:
+ * ace/Thread_Manager.cpp:
+ * ace/Thread_Manager.i:
+ * ace/OS.cpp (uname):
+ Moved a few things (comparison operators) from
+ ACE_Thread_Descriptor to ACE_Thread_Descriptor_Base, to satisfy
+ Borland compilers.
+ Enabled a conditional compilation for all Borland compilers.
+ Thanks to Valik Solorzano Barboza <valik@xs4all.nl> for pointing
+ these things out.
+
Mon Jun 22 01:14:36 1998 Gonzalo Diethelm <gonzo@tango.cs.wustl.edu>
* ace/ACE.bpg:
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 2a7cb7ea913..20a5661ff77 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -107,13 +107,13 @@ ACE_Time_Value::operator FILETIME () const
ACE_Time_Value::FILETIME_to_timval_skew);
FILETIME file_time;
-# if (defined(__BORLANDC__) && __BORLANDC__ >= 0x0530)
+# if defined(__BORLANDC__)
# define LOWPART(x) x.u.LowPart
# define HIGHPART(x) x.u.HighPart
# else
# define LOWPART(x) x.LowPart
# define HIGHPART(x) x.HighPart
-# endif /* (defined(__BORLANDC__) && __BORLANDC__ >= 0x0530) */
+# endif /* defined(__BORLANDC__) */
file_time.dwLowDateTime = LOWPART(_100ns);
file_time.dwHighDateTime = HIGHPART(_100ns);
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp
index 1809f9c847f..c54b83b5d20 100644
--- a/ace/Thread_Manager.cpp
+++ b/ace/Thread_Manager.cpp
@@ -48,19 +48,6 @@ ACE_Thread_Descriptor::~ACE_Thread_Descriptor (void)
}
int
-ACE_Thread_Descriptor::operator==(const ACE_Thread_Descriptor &rhs) const
-{
- return ACE_OS::thr_cmp (this->thr_handle_, rhs.thr_handle_) == 0
- && ACE_OS::thr_equal (this->thr_id_, rhs.thr_id_) == 0;
-}
-
-int
-ACE_Thread_Descriptor::operator!=(const ACE_Thread_Descriptor &rhs) const
-{
- return !(*this == rhs);
-}
-
-int
ACE_Thread_Descriptor::at_exit (void *object,
ACE_CLEANUP_FUNC cleanup_hook,
void *param)
@@ -81,19 +68,18 @@ ACE_Thread_Descriptor::dump (void) const
ACE_TRACE ("ACE_Thread_Descriptor::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_id_ = %d"), this->thr_id_));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_handle_ = %d"), this->thr_handle_));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\ngrp_id_ = %d"), this->grp_id_));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_state_ = %d"), this->thr_state_));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\ncleanup_info_.cleanup_hook_ = %x"), this->cleanup_info_.cleanup_hook_));
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nflags_ = %x\n"), this->flags_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_id_ = %d"), this->thr_id_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_handle_ = %d"), this->thr_handle_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\ngrp_id_ = %d"), this->grp_id_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nthr_state_ = %d"), this->thr_state_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\ncleanup_info_.cleanup_hook_ = %x"), this->cleanup_info_.cleanup_hook_));
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nflags_ = %x\n"), this->flags_));
- ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}
ACE_Thread_Descriptor::ACE_Thread_Descriptor (void)
- : thr_id_ (ACE_OS::NULL_thread),
- grp_id_ (0),
+ : grp_id_ (0),
thr_state_ (ACE_THR_IDLE),
task_ (0)
{
diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h
index 147d8a9c530..1de17f1a4ab 100644
--- a/ace/Thread_Manager.h
+++ b/ace/Thread_Manager.h
@@ -82,7 +82,18 @@ public:
ACE_Thread_Descriptor_Base (void);
~ACE_Thread_Descriptor_Base (void);
+ // = We need the following operators to make Borland happy.
+
+ int operator== (const ACE_Thread_Descriptor_Base &rhs) const;
+ // Equality operator.
+
+ int operator!= (const ACE_Thread_Descriptor_Base &rhs) const;
+ // Inequality operator.
+
protected:
+ ACE_thread_t thr_id_;
+ // Unique thread ID.
+
ACE_hthread_t thr_handle_;
// Unique handle to thread (used by Win32 and AIX).
@@ -142,13 +153,6 @@ public:
~ACE_Thread_Descriptor (void);
// Do nothing destructor to keep some compilers happy
- // = We need the following to make BORLANDC happy.
- int operator== (const ACE_Thread_Descriptor &rhs) const;
- // Equality operator.
-
- int operator!= (const ACE_Thread_Descriptor &rhs) const;
- // Inequality operator.
-
long flags (void) const;
// Get the thread creation flags.
@@ -168,9 +172,6 @@ public:
// of g++ couldn't grok this code without it.
private:
- ACE_thread_t thr_id_;
- // Unique thread ID.
-
int grp_id_;
// Group ID.
diff --git a/ace/Thread_Manager.i b/ace/Thread_Manager.i
index 8ba47742d61..c01207cb2d2 100644
--- a/ace/Thread_Manager.i
+++ b/ace/Thread_Manager.i
@@ -5,7 +5,8 @@
ACE_INLINE
ACE_Thread_Descriptor_Base::ACE_Thread_Descriptor_Base (void)
- : thr_handle_ (ACE_OS::NULL_hthread)
+ : thr_id_ (ACE_OS::NULL_thread),
+ thr_handle_ (ACE_OS::NULL_hthread)
{
}
@@ -14,6 +15,19 @@ ACE_Thread_Descriptor_Base::~ACE_Thread_Descriptor_Base (void)
{
}
+ACE_INLINE int
+ACE_Thread_Descriptor_Base::operator==(const ACE_Thread_Descriptor_Base &rhs) const
+{
+ return ACE_OS::thr_cmp (this->thr_handle_, rhs.thr_handle_) == 0
+ && ACE_OS::thr_equal (this->thr_id_, rhs.thr_id_) == 0;
+}
+
+ACE_INLINE int
+ACE_Thread_Descriptor_Base::operator!=(const ACE_Thread_Descriptor_Base &rhs) const
+{
+ return !(*this == rhs);
+}
+
// Unique thread id.
ACE_INLINE ACE_thread_t
ACE_Thread_Descriptor::self (void)