summaryrefslogtreecommitdiff
path: root/ace/Hash_Map_Manager.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-16 20:04:33 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-16 20:04:33 +0000
commitae2eea130465a785fe48838626fe7aacffbdb26f (patch)
tree52ee246650c52a625dd5743466eb1f1c9479a563 /ace/Hash_Map_Manager.cpp
parent640d0815ab25a360136cb82d701105167fca9148 (diff)
downloadATCD-ae2eea130465a785fe48838626fe7aacffbdb26f.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Hash_Map_Manager.cpp')
-rw-r--r--ace/Hash_Map_Manager.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/ace/Hash_Map_Manager.cpp b/ace/Hash_Map_Manager.cpp
index 86f62013be2..492d6f8097d 100644
--- a/ace/Hash_Map_Manager.cpp
+++ b/ace/Hash_Map_Manager.cpp
@@ -597,9 +597,14 @@ ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::ACE_Hash_Map_Iterator_Base
int head)
: map_man_ (&mm),
index_ (head != 0 ? -1 : ACE_static_cast (ssize_t, mm.total_size_)),
- next_ (0)
+ next_ (0),
+ guard_ (this->map_man_->lock_)
{
ACE_TRACE ("ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::ACE_Hash_Map_Iterator_Base");
+
+ if (this->guard_.locked () == 0)
+ return;
+
if (mm.table_ != 0)
this->next_ = &mm.table_[head != 0 ? 0 : mm.total_size_ - 1];
}
@@ -608,7 +613,6 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> int
ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry)
{
ACE_TRACE ("ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, -1);
if (this->map_man_->table_ != 0
&& this->index_ < ACE_static_cast (ssize_t, this->map_man_->total_size_)
@@ -626,7 +630,6 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> int
ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::done (void) const
{
ACE_TRACE ("ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::done");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, -1);
return this->map_man_->table_ == 0
|| this->index_ >= ACE_static_cast (ssize_t, this->map_man_->total_size_)
@@ -637,7 +640,6 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> int
ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i (void)
{
ACE_TRACE ("ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, -1);
if (this->map_man_->table_ == 0)
return -1;
@@ -669,7 +671,6 @@ template <class EXT_ID, class INT_ID, class ACE_LOCK> int
ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i (void)
{
ACE_TRACE ("ACE_Hash_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, -1);
if (this->map_man_->table_ == 0)
return -1;
@@ -769,7 +770,6 @@ ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)
{
ACE_TRACE ("ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
this->forward_i ();
return *this;
@@ -780,7 +780,6 @@ ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)
{
ACE_TRACE ("ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->forward_i ();
@@ -792,7 +791,6 @@ ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)
{
ACE_TRACE ("ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
this->reverse_i ();
return *this;
@@ -803,7 +801,6 @@ ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)
{
ACE_TRACE ("ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->reverse_i ();
@@ -841,11 +838,9 @@ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)
{
ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
- ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->reverse_i ();
- return retv;
+ return *this;
}
template <class EXT_ID, class INT_ID, class ACE_LOCK>
@@ -853,10 +848,10 @@ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)
{
ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
+ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->reverse_i ();
- return *this;
+ return retv;
}
template <class EXT_ID, class INT_ID, class ACE_LOCK>
@@ -864,11 +859,9 @@ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)
{
ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
- ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->forward_i ();
- return retv;
+ return *this;
}
template <class EXT_ID, class INT_ID, class ACE_LOCK>
@@ -876,10 +869,10 @@ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)
{
ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)");
- ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->map_man_->lock_, *this);
+ ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
this->forward_i ();
- return *this;
+ return retv;
}
#endif /* ACE_HASH_MAP_MANAGER_C */