Author: cctrieloff
Date: 2007-10-12 09:46:08 -0400 (Fri, 12 Oct 2007)
New Revision: 1018
Modified:
store/trunk/cpp/lib/jrnl/enq_map.cpp
store/trunk/cpp/lib/jrnl/enq_map.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
correct logic for rid to be used in locked map for dequeue
Modified: store/trunk/cpp/lib/jrnl/enq_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.cpp 2007-10-12 13:43:02 UTC (rev 1017)
+++ store/trunk/cpp/lib/jrnl/enq_map.cpp 2007-10-12 13:46:08 UTC (rev 1018)
@@ -95,7 +95,7 @@
}
const u_int16_t
-enq_map::get_remove_fid(const u_int64_t rid) throw (jexception)
+enq_map::get_remove_fid(const u_int64_t rid, const bool tx_flag) throw (jexception)
{
pthread_mutex_lock(&_mutex);
emap_itr itr = _map.find(rid);
@@ -106,7 +106,7 @@
ss << std::hex << "rid=0x" << rid;
throw jexception(jerrno::JERR_MAP_NOTFOUND, ss.str(), "enq_map",
"get_remove_fid");
}
- if (itr->second.second) // locked
+ if (itr->second.second && !tx_flag) // locked
{
pthread_mutex_unlock(&_mutex);
std::stringstream ss;
Modified: store/trunk/cpp/lib/jrnl/enq_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.hpp 2007-10-12 13:43:02 UTC (rev 1017)
+++ store/trunk/cpp/lib/jrnl/enq_map.hpp 2007-10-12 13:46:08 UTC (rev 1018)
@@ -74,7 +74,7 @@
void insert_fid(const u_int64_t rid, const u_int16_t fid) throw (jexception);
void insert_fid(const u_int64_t rid, const u_int16_t fid, bool locked) throw
(jexception);
const u_int16_t get_fid(const u_int64_t rid) throw (jexception);
- const u_int16_t get_remove_fid(const u_int64_t rid) throw (jexception);
+ const u_int16_t get_remove_fid(const u_int64_t rid, const bool tx_flag=false)
throw (jexception);
void lock(const u_int64_t rid) throw (jexception);
void unlock(const u_int64_t rid) throw (jexception);
const bool is_locked(const u_int64_t rid) throw (jexception);
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-10-12 13:43:02 UTC (rev 1017)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-10-12 13:46:08 UTC (rev 1018)
@@ -569,7 +569,7 @@
_emap.insert_fid(itr->_rid, itr->_fid);
else // txn dequeue
{
- u_int16_t fid = _emap.get_remove_fid(dtokp->rid());
+ u_int16_t fid = _emap.get_remove_fid(itr->_rid, true);
_wrfc.decr_enqcnt(fid);
}
}