diff options
author | Ben Shteinfeld <ben.shteinfeld@mongodb.com> | 2017-07-11 13:41:27 -0400 |
---|---|---|
committer | Ben Shteinfeld <ben.shteinfeld@mongodb.com> | 2017-07-11 13:41:27 -0400 |
commit | d712243cb381d5ae98d4bc132ace16aac91d0fe9 (patch) | |
tree | fb47636f447044c9a11dae2dd45b40ad697ab976 /src/mongo/db | |
parent | ee08e773208ca4421c72913048915c20b75fac80 (diff) | |
download | mongo-d712243cb381d5ae98d4bc132ace16aac91d0fe9.tar.gz |
Revert "SERVER-29720 Provide libmongodbcapi database wrapper for service context"
This reverts commit ee08e773208ca4421c72913048915c20b75fac80.
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/service_context.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/service_context.h | 11 |
3 files changed, 1 insertions, 27 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 9a38888635d..0f00b00d615 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -1179,7 +1179,7 @@ Status storeMongodOptions(const moe::Environment& params) { } } } else { - if (serverGlobalParams.port < 0 || serverGlobalParams.port > 65535) { + if (serverGlobalParams.port <= 0 || serverGlobalParams.port > 65535) { return Status(ErrorCodes::BadValue, "bad --port number"); } } diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp index 6c93f038eda..f4083be9901 100644 --- a/src/mongo/db/service_context.cpp +++ b/src/mongo/db/service_context.cpp @@ -46,8 +46,6 @@ namespace mongo { namespace { ServiceContext* globalServiceContext = nullptr; -stdx::mutex globalServiceContextMutex; -stdx::condition_variable globalServiceContextCV; } // namespace @@ -60,24 +58,11 @@ ServiceContext* getGlobalServiceContext() { return globalServiceContext; } -ServiceContext* waitAndGetGlobalServiceContext() { - stdx::unique_lock<stdx::mutex> lk(globalServiceContextMutex); - globalServiceContextCV.wait(lk, [] { return globalServiceContext; }); - fassert(40533, globalServiceContext); - return globalServiceContext; -} - void setGlobalServiceContext(std::unique_ptr<ServiceContext>&& serviceContext) { fassert(17509, serviceContext.get()); delete globalServiceContext; - stdx::lock_guard<stdx::mutex> lk(globalServiceContextMutex); - - if (!globalServiceContext) { - globalServiceContextCV.notify_all(); - } - globalServiceContext = serviceContext.release(); } diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h index 9b3d97f1210..3cf830c3fe7 100644 --- a/src/mongo/db/service_context.h +++ b/src/mongo/db/service_context.h @@ -525,17 +525,6 @@ bool hasGlobalServiceContext(); ServiceContext* getGlobalServiceContext(); /** - * Warning - This function is temporary. Do not introduce new uses of this API. - * - * Returns the singleton ServiceContext for this server process. - * - * Waits until there is a valid global ServiceContext. - * - * Caller does not own pointer. - */ -ServiceContext* waitAndGetGlobalServiceContext(); - -/** * Sets the global ServiceContext. If 'serviceContext' is NULL, un-sets and deletes * the current global ServiceContext. * |