summaryrefslogtreecommitdiff
path: root/ace/Message_Queue.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-10-12 15:57:34 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-10-12 15:57:34 +0000
commitc53228114dd0b4974ebdfbc46092e18178ef13bd (patch)
tree081ded1ad0477430f88e261ed6f00b3f204e2f8d /ace/Message_Queue.cpp
parent023a75f6fd511c2703676ad243707dcd300cf89b (diff)
downloadATCD-c53228114dd0b4974ebdfbc46092e18178ef13bd.tar.gz
ChangeLogTag:Tue Oct 12 08:53:52 1999 Irfan Pyarali <irfan@cs.wustl.edu>
Diffstat (limited to 'ace/Message_Queue.cpp')
-rw-r--r--ace/Message_Queue.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp
index fdea0c0a8a7..10bfecd35e5 100644
--- a/ace/Message_Queue.cpp
+++ b/ace/Message_Queue.cpp
@@ -315,13 +315,8 @@ ACE_Message_Queue_NT::enqueue (ACE_Message_Block *new_item,
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
if (!this->deactivated_)
{
- size_t msize = 0;
- ACE_Message_Block *temp;
-
- for (temp = new_item;
- temp != 0;
- temp = temp->cont ())
- msize += temp->size ();
+ size_t msize = new_item->total_size ();
+ size_t mlength = new_item->total_length ();
if (::PostQueuedCompletionStatus (this->completion_port_,
msize,
this->deactivated_,
@@ -329,7 +324,7 @@ ACE_Message_Queue_NT::enqueue (ACE_Message_Block *new_item,
{
// Update the states once I succeed.
this->cur_bytes_ += msize;
- this->cur_length_ += temp->length ();
+ this->cur_length_ += mlength;
return ++this->cur_count_;
}
}
@@ -374,7 +369,7 @@ ACE_Message_Queue_NT::dequeue (ACE_Message_Block *&first_item,
{ // Really get a valid MB from the queue.
--this->cur_count_;
this->cur_bytes_ -= msize;
- this->cur_length_ -= first_item->length ();
+ this->cur_length_ -= first_item->total_length ();
return this->cur_count_;
}
else // I am woken up by deactivate ().