[rhmessaging-commits] rhmessaging commits: r4444 - store/trunk/cpp/lib.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Feb 25 11:42:06 EST 2011


Author: kpvdr
Date: 2011-02-25 11:42:06 -0500 (Fri, 25 Feb 2011)
New Revision: 4444

Modified:
   store/trunk/cpp/lib/MessageStoreImpl.cpp
   store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Fix for BZ680228 - "[store] Deadlock in BDB database del() function". Added a lock into the MessageStoreImpl::destroy() function.

Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp	2011-02-22 18:21:16 UTC (rev 4443)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp	2011-02-25 16:42:06 UTC (rev 4444)
@@ -630,6 +630,7 @@
 
 void MessageStoreImpl::destroy(db_ptr db, const qpid::broker::Persistable& p)
 {
+    qpid::sys::Mutex::ScopedLock sl(bdbLock);
     IdDbt key(p.getPersistenceId());
     db->del(0, &key, DB_AUTO_COMMIT);
 }

Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h	2011-02-22 18:21:16 UTC (rev 4443)
+++ store/trunk/cpp/lib/MessageStoreImpl.h	2011-02-25 16:42:06 UTC (rev 4444)
@@ -131,6 +131,7 @@
     qpid::sys::Mutex tplInitLock;
     JournalListMap journalList;
     qpid::sys::Mutex journalListLock;
+    qpid::sys::Mutex bdbLock;
 
     IdSequence queueIdSequence;
     IdSequence exchangeIdSequence;



More information about the rhmessaging-commits mailing list