Author: kpvdr
Date: 2007-09-17 11:42:33 -0400 (Mon, 17 Sep 2007)
New Revision: 925
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
Log:
Fixed problem where JERR__NINIT was being thrown when uninitialized journal was
destructing
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-14 18:45:18 UTC (rev 924)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-17 15:42:33 UTC (rev 925)
@@ -65,6 +65,8 @@
jcntl::~jcntl()
{
+ try { stop(true); }
+ catch (jexception& e) {}
if (_datafh)
{
for (u_int32_t i=0; i<JRNL_NUM_FILES; i++)
@@ -208,11 +210,9 @@
jcntl::aio_cmpl_wait() throw (jexception)
{
u_int32_t cnt = 0;
- u_int32_t rem = _wmgr.get_aio_evt_rem();
- while (rem)
+ while (_wmgr.get_aio_evt_rem())
{
get_wr_events();
- rem = _wmgr.get_aio_evt_rem();
if (cnt++ > MAX_AIO_CMPL_SLEEPS)
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl",
"aio_cmpl_wait");
usleep(AIO_CMPL_SLEEP);
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-09-14 18:45:18 UTC (rev 924)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-09-17 15:42:33 UTC (rev 925)
@@ -169,11 +169,16 @@
void initialize(std::deque<data_tok*>* rd_dtokl, const aio_cb rd_cb,
std::deque<data_tok*>* wr_dtokl, const aio_cb wr_cb) throw (jexception);
- void initialize() {
- initialize(&_aio_rd_cmpl_dtok_list, &aio_rd_callback,
&_aio_wr_cmpl_dtok_list, &aio_wr_callback );
- }
+ /**
+ * Initialize using internal default callbacks and data_tok lists.
+ * TODO: Move to JournalImpl later
+ */
+ void initialize()
+ {
+ initialize(&_aio_rd_cmpl_dtok_list, &aio_rd_callback,
&_aio_wr_cmpl_dtok_list,
+ &aio_wr_callback );
+ }
-
/// replace with real code to recover
// void recover(std::deque<data_tok*>* rd_dtokl, const aio_cb rd_cb,
// std::deque<data_tok*>* wr_dtokl, const aio_cb wr_cb) throw (jexception);
@@ -182,6 +187,7 @@
void recover() {
initialize(&_aio_rd_cmpl_dtok_list, &aio_rd_callback,
&_aio_wr_cmpl_dtok_list, &aio_wr_callback );
}
+ void recovered() {}
/**
Show replies by date