diff options
author | William Schultz <william.schultz@mongodb.com> | 2018-01-17 08:42:40 -0500 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2018-01-17 08:42:40 -0500 |
commit | aa35454e98a3026a7c44cc736d2326a3fa38e7b3 (patch) | |
tree | 1c34f53b6afac20605dd1e8e9e951802afe3fb43 /src/mongo/db/background.cpp | |
parent | f7d45863daa61920d3b6ee8abbf105833767a223 (diff) | |
download | mongo-aa35454e98a3026a7c44cc736d2326a3fa38e7b3.tar.gz |
SERVER-30818 Add function to await background operations on multiple databases
Diffstat (limited to 'src/mongo/db/background.cpp')
-rw-r--r-- | src/mongo/db/background.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index 18af0509631..555062f7e63 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -147,6 +147,13 @@ void BackgroundOperation::assertNoBgOpInProgForNs(StringData ns) { !inProgForNs(ns)); } +void BackgroundOperation::awaitNoBgOpInProgForDbs(std::vector<StringData> dbs) { + stdx::unique_lock<stdx::mutex> lk(m); + for (auto db : dbs) { + awaitNoBgOps(lk, &dbsInProg, db); + } +} + void BackgroundOperation::awaitNoBgOpInProgForDb(StringData db) { stdx::unique_lock<stdx::mutex> lk(m); awaitNoBgOps(lk, &dbsInProg, db); |