The database is not reentrant, so we need a ScopedLock to gate it.

This commit is contained in:
JoelKatz
2011-12-02 16:22:10 -08:00
parent 26171e6dec
commit 089687152e

View File

@@ -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; }