Author: kpvdr
Date: 2010-05-21 12:46:34 -0400 (Fri, 21 May 2010)
New Revision: 3982
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Removed redundant locks; the previous checkin installed the correct lock in
JournalImpl::JournalImpl.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-21 15:02:52 UTC (rev 3981)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-21 16:46:34 UTC (rev 3982)
@@ -410,12 +410,9 @@
{
// Don't take lock unless necessary
if (!tplStorePtr->is_ready()) {
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- if (!tplStorePtr->is_ready()) {
- journal::jdir::create_dir(getTplBaseDir());
- tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks,
tplWCacheNumPages, tplWCachePgSizeSblks);
- if (mgmtObject != 0) mgmtObject->set_tplIsInitialized(true);
- }
+ journal::jdir::create_dir(getTplBaseDir());
+ tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks,
tplWCacheNumPages, tplWCachePgSizeSblks);
+ if (mgmtObject != 0) mgmtObject->set_tplIsInitialized(true);
}
}
@@ -481,14 +478,9 @@
return;
}
+ jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
std::string("JournalData"),
+ defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
{
- // TODO: Is this mutex necessary?
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
- std::string("JournalData"),
defJournalGetEventsTimeout,
- defJournalFlushTimeout, agent);
- }
- {
qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queue.getName()]=jQueue;
}
@@ -769,11 +761,9 @@
QPID_LOG(error, "Cannot recover empty (null) queue name - ignoring and
attempting to continue.");
break;
}
+ jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName),
std::string("JournalData"),
+ defJournalGetEventsTimeout, defJournalFlushTimeout,
agent);
{
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName),
std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout,
agent);
- }
- {
qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queueName] = jQueue;
}
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-21 15:02:52 UTC (rev 3981)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-21 16:46:34 UTC (rev 3982)
@@ -93,7 +93,6 @@
typedef std::map<std::string, TplRecover> TplRecoverMap;
typedef TplRecoverMap::const_iterator TplRecoverMapCitr;
- typedef std::pair<std::string, JournalImpl*> JournalListPair;
typedef std::map<std::string, JournalImpl*> JournalListMap;
typedef JournalListMap::iterator JournalListMapItr;
@@ -149,7 +148,6 @@
const char* envPath;
qmf::com::redhat::rhm::store::Store* mgmtObject;
- qpid::sys::Mutex jrnlCreateLock;
qpid::management::ManagementAgent* agent;
// Parameter validation and calculation