Author: cctrieloff
Date: 2007-09-17 12:05:40 -0400 (Mon, 17 Sep 2007)
New Revision: 926
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
correction in ~() for jrnl
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-17 15:42:33 UTC (rev 925)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-17 16:05:40 UTC (rev 926)
@@ -65,8 +65,8 @@
jcntl::~jcntl()
{
- try { stop(true); }
- catch (jexception& e) {}
+ if (_init_flag && !_stop_flag)
+ stop(true);
if (_datafh)
{
for (u_int32_t i=0; i<JRNL_NUM_FILES; i++)
@@ -223,10 +223,11 @@
jcntl::aio_wr_callback(jcntl* journal, u_int32_t num_dtoks)
{
-//kpvdr TODO -- can we get rid of the copy???
+//kpvdr TODO -- this list needs to be mutexed...???
// need to delete the dtok's
std::deque<rhm::journal::data_tok*>
this_dtok_list(journal->_aio_wr_cmpl_dtok_list.begin(),
journal->_aio_wr_cmpl_dtok_list.end());
+
journal->_aio_wr_cmpl_dtok_list.clear();
for (u_int32_t i=0; i<num_dtoks; i++)
{
@@ -234,14 +235,23 @@
data_tok::write_state st = dtokp->wstate();
if (st == data_tok::ENQ)
{
+//std::cout << "----- enqueueComplete rid=" << dtokp->rid()
<< std::endl;
+
dtokp->getSourceMessage()->enqueueComplete();
/// cct --- if TPC work out what to do !!!
}
else if (dtokp->wstate() == data_tok::DEQ)
{
+//std::cout << "----- dequeueComplete rid=" << dtokp->rid()
<< std::endl;
+
dtokp->getSourceMessage()->dequeueComplete();
+
+ if ( dtokp->getSourceMessage()->isDequeueComplete() ) // clear id after last
dequeue
+ dtokp->getSourceMessage()->setPersistenceId(0);
+
}
this_dtok_list.pop_front();
+ delete dtokp;
}
}
@@ -261,6 +271,7 @@
// cct call the recovery manager. / lazyload..
}
this_dtok_list.pop_front();
+ delete dtokp;
}
}