From 089687152e4103953340a613f016c37bddaf8320 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 2 Dec 2011 16:22:10 -0800 Subject: [PATCH] The database is not reentrant, so we need a ScopedLock to gate it. --- Application.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application.h b/Application.h index e4c5e9b968..f1260050dc 100644 --- a/Application.h +++ b/Application.h @@ -5,6 +5,7 @@ #include "ConnectionPool.h" #include "KnownNodeList.h" #include "TimingService.h" +#include "ScopedLock.h" #include "Wallet.h" #include "database/database.h" @@ -29,7 +30,7 @@ class Application //Serializer* mSerializer; boost::asio::io_service mIOService; - + boost::recursive_mutex dbLock; public: @@ -39,6 +40,7 @@ public: UniqueNodeList& getUNL(){ return(mUNL); } Wallet& getWallet(){ return(mWallet); } Database* getDB(){ return(mDatabase); } + ScopedLock getDBLock() { return ScopedLock(dbLock); } void setDB(Database* db){ mDatabase=db; }