Author: kpvdr
Date: 2010-06-08 15:11:00 -0400 (Tue, 08 Jun 2010)
New Revision: 4017
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Fix for a recent regression in r.3982 in which a lock wich protects the TPL from being
initialized by multiple threads was erroneously removed. The lock is now replaced.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-06-08 18:35:59 UTC (rev 4016)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-06-08 19:11:00 UTC (rev 4017)
@@ -408,7 +408,8 @@
void MessageStoreImpl::chkTplStoreInit()
{
- // Don't take lock unless necessary
+ // Prevent multiple threads from late-initializing the TPL
+ qpid::sys::Mutex::ScopedLock sl(tplInitLock);
if (!tplStorePtr->is_ready()) {
journal::jdir::create_dir(getTplBaseDir());
tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks,
tplWCacheNumPages, tplWCachePgSizeSblks);
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2010-06-08 18:35:59 UTC (rev 4016)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2010-06-08 19:11:00 UTC (rev 4017)
@@ -124,6 +124,7 @@
// Pointer to Transaction Prepared List (TPL) journal instance
boost::shared_ptr<TplJournalImpl> tplStorePtr;
TplRecoverMap tplRecoverMap;
+ qpid::sys::Mutex tplInitLock;
JournalListMap journalList;
qpid::sys::Mutex journalListLock;