diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2014-04-18 15:28:50 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2014-04-21 11:17:37 -0400 |
commit | 001b2c1ee301f814c4b9128b2f0ef1ee1354a4f1 (patch) | |
tree | aae749fbf8554a03c2cc334c05b7815dfb7f48bc /src/mongo/db/background.h | |
parent | 9be380c23afdad4ab7c4b09762f2f3d95caf674f (diff) | |
download | mongo-001b2c1ee301f814c4b9128b2f0ef1ee1354a4f1.tar.gz |
SERVER-13620 Refactor background.h/cpp; add awaitNoBgOp methods.
(cherry picked from commit 9ad97ac9fd08cf56d4e6c4bdb5c1b10085b9040c)
Diffstat (limited to 'src/mongo/db/background.h')
-rw-r--r-- | src/mongo/db/background.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/background.h b/src/mongo/db/background.h index 7cde9ffa8de..3db4767f95a 100644 --- a/src/mongo/db/background.h +++ b/src/mongo/db/background.h @@ -35,12 +35,11 @@ #include <map> #include <set> -#include <string> -#include <sstream> +#include <iosfwd> +#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/namespace_string.h" -#include "mongo/util/concurrency/mutex.h" namespace mongo { @@ -54,13 +53,16 @@ namespace mongo { It's assumed this is not for super-high RPS things, so we don't do anything special in the implementation here to be fast. */ - class BackgroundOperation : public boost::noncopyable { + class BackgroundOperation { + MONGO_DISALLOW_COPYING(BackgroundOperation); public: static bool inProgForDb(const StringData& db); static bool inProgForNs(const StringData& ns); static void assertNoBgOpInProgForDb(const StringData& db); static void assertNoBgOpInProgForNs(const StringData& ns); - static void dump(std::stringstream&); + static void awaitNoBgOpInProgForDb(const StringData& db); + static void awaitNoBgOpInProgForNs(const StringData& ns); + static void dump(std::ostream&); /* check for in progress before instantiating */ BackgroundOperation(const StringData& ns); @@ -69,9 +71,6 @@ namespace mongo { private: NamespaceString _ns; - static std::map<std::string, unsigned> dbsInProg; - static std::set<std::string> nsInProg; - static SimpleMutex m; }; } // namespace mongo |