From aa33fbed928ca26fa0832dcc9cedc898d34dc947 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 3 Jun 2013 11:04:05 -0700 Subject: [PATCH] Merge ripple_db into ripple_main because of circular dependencies --- modules/ripple_db/ripple_db.cpp | 4 ---- modules/ripple_main/ripple_main.cpp | 5 +++++ newcoin.vcxproj.filters | 26 +++++++++++++------------- src/cpp/ripple/JobQueue.h | 18 ++++++++++-------- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/modules/ripple_db/ripple_db.cpp b/modules/ripple_db/ripple_db.cpp index f0091a8c49..f3c8eb0887 100644 --- a/modules/ripple_db/ripple_db.cpp +++ b/modules/ripple_db/ripple_db.cpp @@ -23,7 +23,3 @@ */ #include "ripple_db.h" - -#include "src/cpp/database/database.cpp" -#include "src/cpp/database/SqliteDatabase.cpp" -#include "src/cpp/ripple/DBInit.cpp" diff --git a/modules/ripple_main/ripple_main.cpp b/modules/ripple_main/ripple_main.cpp index 98e03a6c30..3be9a6177e 100644 --- a/modules/ripple_main/ripple_main.cpp +++ b/modules/ripple_main/ripple_main.cpp @@ -169,6 +169,11 @@ static DH* handleTmpDh(SSL* ssl, int is_export, int iKeyLength) #include "src/cpp/ripple/UpdateTables.cpp" #include "src/cpp/ripple/main.cpp" +// storage +#include "src/cpp/database/database.cpp" +#include "src/cpp/database/SqliteDatabase.cpp" +#include "src/cpp/ripple/DBInit.cpp" + // contracts #include "src/cpp/ripple/Contract.cpp" // no log #include "src/cpp/ripple/Interpreter.cpp" // no log diff --git a/newcoin.vcxproj.filters b/newcoin.vcxproj.filters index ee49344c15..869166ac41 100644 --- a/newcoin.vcxproj.filters +++ b/newcoin.vcxproj.filters @@ -52,15 +52,9 @@ {84e43f43-816e-4ccd-80c2-38b322904894} - - {a5190241-c5bc-4e23-8ef1-6adf757c75e3} - {1a379c07-ccf1-4636-8018-2cfc0685edf0} - - {6097a179-ddad-4c69-9a34-2e3fc2c9fa1d} - {96cbc9ff-0118-4844-bb4c-05aef58a60b5} @@ -139,6 +133,12 @@ {97c96b68-70fd-4679-89fc-c1c8c87c265e} + + {6097a179-ddad-4c69-9a34-2e3fc2c9fa1d} + + + {a5190241-c5bc-4e23-8ef1-6adf757c75e3} + @@ -592,16 +592,16 @@ 1. Modules\ripple_main\rpc - 1. Modules\ripple_db + 2. Empty\ripple_db - 1. Modules\ripple_db\storage + 1. Modules\ripple_main\storage - 1. Modules\ripple_db\storage + 1. Modules\ripple_main\storage - 1. Modules\ripple_db\storage + 1. Modules\ripple_main\storage 1. Modules\ripple_main @@ -1248,13 +1248,13 @@ 1. Modules\ripple_main\rpc - 1. Modules\ripple_db + 2. Empty\ripple_db - 1. Modules\ripple_db\storage + 1. Modules\ripple_main\storage - 1. Modules\ripple_db\storage + 1. Modules\ripple_main\storage 1. Modules\ripple_main diff --git a/src/cpp/ripple/JobQueue.h b/src/cpp/ripple/JobQueue.h index a855e32690..9c20376c7b 100644 --- a/src/cpp/ripple/JobQueue.h +++ b/src/cpp/ripple/JobQueue.h @@ -11,6 +11,9 @@ #include #include +// VFALCO: Does this belong here? +#include "ripple_LoadEvent.h" + #include "LoadMonitor.h" // Note that this queue should only be used for CPU-bound jobs @@ -61,6 +64,7 @@ public: Job(JobType type, const std::string& name, uint64 index, LoadMonitor& lm, const FUNCTION_TYPE& job) : mType(type), mJobIndex(index), mJob(job), mName(name) { + // VFALCO: NOTE, what the heck does this mean? mLoadMonitor = boost::make_shared(boost::ref(lm), name, false); } @@ -86,8 +90,7 @@ protected: class JobQueue { public: - - JobQueue(boost::asio::io_service&); + explicit JobQueue (boost::asio::io_service&); void addJob(JobType type, const std::string& name, const FUNCTION_TYPE& job); @@ -112,8 +115,11 @@ public: int isOverloaded(); Json::Value getJson(int c = 0); -protected: - boost::mutex mJobLock; +private: + void threadEntry(); + void IOThread(boost::mutex::scoped_lock&); + + boost::mutex mJobLock; boost::condition_variable mJobCond; uint64 mLastJob; @@ -127,10 +133,6 @@ protected: boost::asio::io_service& mIOService; std::map > mJobCounts; - - - void threadEntry(); - void IOThread(boost::mutex::scoped_lock&); }; #endif