summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-02-01 08:09:10 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-02-01 08:09:10 +0000
commit688e5c8f6f7cb42ddcdb5698fdf99d49298cc443 (patch)
tree40ab70eae899685567e574c12ea0c080d7bf0cb3
parent7402df8d7df01ae1569912725478a2376af622df (diff)
downloadATCD-688e5c8f6f7cb42ddcdb5698fdf99d49298cc443.tar.gz
Thu Feb 1 08:05:14 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ACE/ChangeLog9
-rw-r--r--ACE/ace/Message_Queue.cpp14
-rw-r--r--ACE/ace/Message_Queue.h2
-rw-r--r--ACE/ace/Message_Queue.inl6
-rw-r--r--ACE/ace/OS_NS_Thread.cpp22
5 files changed, 26 insertions, 27 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 22fa3ae0979..6cf696f0262 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,12 @@
+Thu Feb 1 08:05:14 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Message_Queue.{h,cpp,inl}:
+ Fixed compile errors in the NT Message Queue when build without
+ threading under windows
+
+ * ace/OS_NS_Thread.cpp:
+ Layout changes
+
Wed Jan 31 23:06:42 UTC 2007 Adam Mitz <mitza@ociweb.com>
* ace/config-qnx-rtp-62x.h:
diff --git a/ACE/ace/Message_Queue.cpp b/ACE/ace/Message_Queue.cpp
index 7295c2b9c8f..4b937e543a4 100644
--- a/ACE/ace/Message_Queue.cpp
+++ b/ACE/ace/Message_Queue.cpp
@@ -409,7 +409,7 @@ int
ACE_Message_Queue_NT::close (void)
{
ACE_TRACE ("ACE_Message_Queue_NT::close");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
this->deactivate ();
return (::CloseHandle (this->completion_port_) ? 0 : -1 );
}
@@ -425,7 +425,7 @@ ACE_Message_Queue_NT::enqueue (ACE_Message_Block *new_item,
ACE_Time_Value *)
{
ACE_TRACE ("ACE_Message_Queue_NT::enqueue");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
if (this->state_ != ACE_Message_Queue_Base::DEACTIVATED)
{
size_t const msize = new_item->total_size ();
@@ -459,7 +459,7 @@ ACE_Message_Queue_NT::dequeue (ACE_Message_Block *&first_item,
ACE_TRACE ("ACE_Message_Queue_NT::dequeue_head");
{
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
// Make sure the MQ is not deactivated before proceeding.
if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)
@@ -480,7 +480,7 @@ ACE_Message_Queue_NT::dequeue (ACE_Message_Block *&first_item,
reinterpret_cast<LPOVERLAPPED *> (&first_item),
(timeout == 0 ? INFINITE : timeout->msec ()));
{
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
--this->cur_thrs_; // Decrease waiting thread count.
if (retv)
{
@@ -502,7 +502,7 @@ int
ACE_Message_Queue_NT::deactivate (void)
{
ACE_TRACE ("ACE_Message_Queue_NT::deactivate");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
int const previous_state = this->state_;
if (previous_state != ACE_Message_Queue_Base::DEACTIVATED)
@@ -526,7 +526,7 @@ int
ACE_Message_Queue_NT::activate (void)
{
ACE_TRACE ("ACE_Message_Queue_NT::activate");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
int const previous_status = this->state_;
this->state_ = ACE_Message_Queue_Base::ACTIVATED;
return previous_status;
@@ -536,7 +536,7 @@ int
ACE_Message_Queue_NT::pulse (void)
{
ACE_TRACE ("ACE_Message_Queue_NT::pulse");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
int const previous_state = this->state_;
if (previous_state != ACE_Message_Queue_Base::DEACTIVATED)
diff --git a/ACE/ace/Message_Queue.h b/ACE/ace/Message_Queue.h
index 5a4b26fbfd6..6e92639459f 100644
--- a/ACE/ace/Message_Queue.h
+++ b/ACE/ace/Message_Queue.h
@@ -611,7 +611,7 @@ private:
* but since this class is only supported on NT, it's okay to use
* ACE_Thread_Mutex here.
*/
- ACE_Thread_Mutex lock_;
+ ACE_SYNCH_MUTEX lock_;
/// Underlying NT IoCompletionPort.
ACE_HANDLE completion_port_;
diff --git a/ACE/ace/Message_Queue.inl b/ACE/ace/Message_Queue.inl
index 452b33f8e6f..355ae57fdec 100644
--- a/ACE/ace/Message_Queue.inl
+++ b/ACE/ace/Message_Queue.inl
@@ -54,7 +54,7 @@ ACE_INLINE int
ACE_Message_Queue_NT::is_empty (void)
{
ACE_TRACE ("ACE_Message_Queue_NT::is_empty");
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0);
return this->cur_bytes_ > 0 || this->cur_count_ > 0 ? 0 : 1;
}
@@ -87,7 +87,7 @@ ACE_INLINE void
ACE_Message_Queue_NT::message_bytes (size_t new_value)
{
ACE_TRACE ("ACE_Message_Queue_NT::message_bytes");
- ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_);
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_);
this->cur_bytes_ = new_value;
}
@@ -96,7 +96,7 @@ ACE_INLINE void
ACE_Message_Queue_NT::message_length (size_t new_value)
{
ACE_TRACE ("ACE_Message_Queue_NT::message_length");
- ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_);
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_);
this->cur_length_ = new_value;
}
diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp
index 505d8bada17..ca6fc3046d0 100644
--- a/ACE/ace/OS_NS_Thread.cpp
+++ b/ACE/ace/OS_NS_Thread.cpp
@@ -4784,9 +4784,7 @@ ACE_OS::thr_get_affinity (ACE_hthread_t thr_id,
{
#if defined (ACE_HAS_PTHREAD_GETAFFINITY_NP)
// Handle of the thread, which is NPTL thread-id, normally a big number
- if (::pthread_getaffinity_np (thr_id,
- cpu_set_size,
- cpu_mask) != 0)
+ if (::pthread_getaffinity_np (thr_id, cpu_set_size, cpu_mask) != 0)
{
return -1;
}
@@ -4797,8 +4795,7 @@ ACE_OS::thr_get_affinity (ACE_hthread_t thr_id,
// If you are using this flag for NPTL-threads, however, please pass as a
// thr_id process id obtained by ACE_OS::getpid ()
ACE_UNUSED_ARG (cpu_set_size);
- if (::sched_getaffinity(thr_id,
- cpu_mask) == -1)
+ if (::sched_getaffinity(thr_id, cpu_mask) == -1)
{
return -1;
}
@@ -4808,9 +4805,7 @@ ACE_OS::thr_get_affinity (ACE_hthread_t thr_id,
// linux-thread, thus making binding to cpu of that particular thread only.
// If you are using this flag for NPTL-threads, however, please pass as a
// thr_id process id obtained by ACE_OS::getpid ()
- if (::sched_getaffinity(thr_id,
- cpu_set_size,
- cpu_mask) == -1)
+ if (::sched_getaffinity(thr_id, cpu_set_size, cpu_mask) == -1)
{
return -1;
}
@@ -4829,9 +4824,7 @@ ACE_OS::thr_set_affinity (ACE_hthread_t thr_id,
const cpu_set_t * cpu_mask)
{
#if defined (ACE_HAS_PTHREAD_SETAFFINITY_NP)
- if (::pthread_setaffinity_np (thr_id,
- cpu_set_size,
- cpu_mask) != 0)
+ if (::pthread_setaffinity_np (thr_id, cpu_set_size, cpu_mask) != 0)
{
return -1;
}
@@ -4843,8 +4836,7 @@ ACE_OS::thr_set_affinity (ACE_hthread_t thr_id,
// thr_id process id obtained by ACE_OS::getpid (), but whole process will bind your CPUs
//
ACE_UNUSED_ARG (cpu_set_size);
- if (::sched_setaffinity (thr_id,
- cpu_mask) == -1)
+ if (::sched_setaffinity (thr_id, cpu_mask) == -1)
{
return -1;
}
@@ -4855,9 +4847,7 @@ ACE_OS::thr_set_affinity (ACE_hthread_t thr_id,
// If you are using this flag for NPTL-threads, however, please pass as a
// thr_id process id obtained by ACE_OS::getpid (), but whole process will bind your CPUs
//
- if (::sched_setaffinity (thr_id,
- cpu_set_size,
- cpu_mask) == -1)
+ if (::sched_setaffinity (thr_id, cpu_set_size, cpu_mask) == -1)
{
return -1;
}