summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-03-13 10:51:11 -0400
committerLouis Williams <louis.williams@mongodb.com>2019-03-13 10:51:11 -0400
commit3b699913831031091fbba8a2a91178ef7826cf8b (patch)
treeee6922dba02c7a1045a26e6d5e6d0c9425678125 /src
parent8d56e85e389832950a46c912903db3c1c742e292 (diff)
downloadmongo-3b699913831031091fbba8a2a91178ef7826cf8b.tar.gz
SERVER-39279 Remove ServiceContext::waitForClientsToFinish
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/service_context.cpp11
-rw-r--r--src/mongo/db/service_context.h9
-rw-r--r--src/mongo/db/service_context_test_fixture.cpp3
3 files changed, 0 insertions, 23 deletions
diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp
index ac8937dbc6c..bd24819b416 100644
--- a/src/mongo/db/service_context.cpp
+++ b/src/mongo/db/service_context.cpp
@@ -226,9 +226,6 @@ void ServiceContext::ClientDeleter::operator()(Client* client) const {
{
stdx::lock_guard<stdx::mutex> lk(service->_mutex);
invariant(service->_clients.erase(client));
- if (service->_clients.empty()) {
- service->_clientsEmptyCondVar.notify_all();
- }
}
onDestroy(client, service->_clientObservers);
delete client;
@@ -343,14 +340,6 @@ void ServiceContext::waitForStartupComplete() {
_startupCompleteCondVar.wait(lk, [this] { return _startupComplete; });
}
-void ServiceContext::waitForClientsToFinish() {
- stdx::unique_lock<stdx::mutex> lk(_mutex);
- for (const auto& client : _clients) {
- log() << "Waiting for client " << client->desc() << " to exit";
- }
- _clientsEmptyCondVar.wait(lk, [this] { return _clients.empty(); });
-}
-
void ServiceContext::notifyStartupComplete() {
stdx::unique_lock<stdx::mutex> lk(_mutex);
_startupComplete = true;
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h
index 0287dfc68bb..5e54e8684d9 100644
--- a/src/mongo/db/service_context.h
+++ b/src/mongo/db/service_context.h
@@ -421,14 +421,6 @@ public:
*/
void waitForStartupComplete();
- /**
- * Wait for all clients to complete and unregister themselves. Shutting-down, unmanaged threads
- * may potentially be unable to acquire the service context mutex before the service context
- * itself does on destruction.
- * Used for testing.
- */
- void waitForClientsToFinish();
-
/*
* Marks initialization as complete and all transport layers as started.
*/
@@ -569,7 +561,6 @@ private:
*/
std::vector<ClientObserverHolder> _clientObservers;
ClientSet _clients;
- stdx::condition_variable _clientsEmptyCondVar;
/**
* The registered OpObserver.
diff --git a/src/mongo/db/service_context_test_fixture.cpp b/src/mongo/db/service_context_test_fixture.cpp
index f6f92e1d18a..4ac6fc023e2 100644
--- a/src/mongo/db/service_context_test_fixture.cpp
+++ b/src/mongo/db/service_context_test_fixture.cpp
@@ -47,9 +47,6 @@ ScopedGlobalServiceContextForTest::ScopedGlobalServiceContextForTest() {
}
ScopedGlobalServiceContextForTest::~ScopedGlobalServiceContextForTest() {
- if (hasGlobalServiceContext()) {
- getGlobalServiceContext()->waitForClientsToFinish();
- }
setGlobalServiceContext({});
}