From 2cfcda1440ce976f02e138c0851c449b2181f0b1 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 2 Jun 2013 09:28:14 -0700 Subject: [PATCH] Use ScopedLock RAII for some Application members Conflicts: src/cpp/ripple/Application.h --- src/cpp/leveldb_core.cpp | 11 +++++++++++ src/cpp/ripple/Application.cpp | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/cpp/leveldb_core.cpp b/src/cpp/leveldb_core.cpp index 566743ed89..8da5afb453 100644 --- a/src/cpp/leveldb_core.cpp +++ b/src/cpp/leveldb_core.cpp @@ -8,6 +8,12 @@ # define LEVELDB_PLATFORM_POSIX #endif +#ifdef _MSC_VER +#pragma warning (push) +#pragma warning (disable: 4018) // signed/unsigned mismatch +#pragma warning (disable: 4244) // conversion, possible loss of data +#endif + #include "leveldb/db/builder.cc" #include "leveldb/db/db_impl.cc" #include "leveldb/db/db_iter.cc" @@ -85,3 +91,8 @@ //#include "leveldb/table/filter_block_test.cc" //#include "leveldb/table/table_test.cc" + +#ifdef _MSC_VER +#pragma warning (pop) +#endif + diff --git a/src/cpp/ripple/Application.cpp b/src/cpp/ripple/Application.cpp index c06f568440..d89794e7fa 100644 --- a/src/cpp/ripple/Application.cpp +++ b/src/cpp/ripple/Application.cpp @@ -398,6 +398,10 @@ void Application::sweep() theApp->stop(); } + // VFALCO: NOTE, Does the order of calls matter? + // VFALCO: TODO, fix the dependency inversion using an observer, + // have listeners register for "onSweep ()" notification. + // mMasterTransaction.sweep(); mHashedObjectStore.sweep(); mLedgerMaster.sweep(); @@ -405,9 +409,10 @@ void Application::sweep() mValidations->sweep(); getMasterLedgerAcquire().sweep(); mSLECache.sweep(); - AcceptedLedger::sweep(); - SHAMap::sweep(); + AcceptedLedger::sweep(); // VFALCO: NOTE, AcceptedLedger is/has a singleton? + SHAMap::sweep(); // VFALCO: NOTE, SHAMap is/has a singleton? mNetOps.sweepFetchPack(); + // VFALCO: NOTE, does the call to sweep() happen on another thread? mSweepTimer.expires_from_now(boost::posix_time::seconds(theConfig.getSize(siSweepInterval))); mSweepTimer.async_wait(boost::bind(&Application::sweep, this)); }