summaryrefslogtreecommitdiff
path: root/src/mongo/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/util')
-rw-r--r--src/mongo/util/background.cpp3
-rw-r--r--src/mongo/util/concurrency/spin_lock_test.cpp3
-rw-r--r--src/mongo/util/concurrency/thread_pool.h4
-rw-r--r--src/mongo/util/concurrency/thread_pool_test_common.cpp6
-rw-r--r--src/mongo/util/concurrency/thread_pool_test_common.h5
-rw-r--r--src/mongo/util/decoration_registry.h1
-rw-r--r--src/mongo/util/exit.cpp2
-rw-r--r--src/mongo/util/fail_point.cpp2
-rw-r--r--src/mongo/util/fail_point.h5
-rw-r--r--src/mongo/util/fail_point_test.cpp2
-rw-r--r--src/mongo/util/invalidating_lru_cache_test.cpp8
-rw-r--r--src/mongo/util/lru_cache_test.cpp2
-rw-r--r--src/mongo/util/net/ssl_manager.cpp2
-rw-r--r--src/mongo/util/options_parser/options_parser.cpp2
-rw-r--r--src/mongo/util/options_parser/options_parser.h4
-rw-r--r--src/mongo/util/periodic_runner.h4
-rw-r--r--src/mongo/util/queue.h4
17 files changed, 30 insertions, 29 deletions
diff --git a/src/mongo/util/background.cpp b/src/mongo/util/background.cpp
index 3627a413f1b..441cdab0e53 100644
--- a/src/mongo/util/background.cpp
+++ b/src/mongo/util/background.cpp
@@ -33,9 +33,10 @@
#include "mongo/util/background.h"
+#include <functional>
+
#include "mongo/config.h"
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/concurrency/idle_thread_block.h"
diff --git a/src/mongo/util/concurrency/spin_lock_test.cpp b/src/mongo/util/concurrency/spin_lock_test.cpp
index 70c5288f86e..62266221b2a 100644
--- a/src/mongo/util/concurrency/spin_lock_test.cpp
+++ b/src/mongo/util/concurrency/spin_lock_test.cpp
@@ -29,7 +29,8 @@
#include "mongo/platform/basic.h"
-#include "mongo/stdx/functional.h"
+#include <functional>
+
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/concurrency/spin_lock.h"
diff --git a/src/mongo/util/concurrency/thread_pool.h b/src/mongo/util/concurrency/thread_pool.h
index c4873f84dff..bbae97d1ebe 100644
--- a/src/mongo/util/concurrency/thread_pool.h
+++ b/src/mongo/util/concurrency/thread_pool.h
@@ -30,11 +30,11 @@
#pragma once
#include <deque>
+#include <functional>
#include <string>
#include <vector>
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/concurrency/thread_pool_interface.h"
@@ -89,7 +89,7 @@ public:
Milliseconds maxIdleThreadAge = Seconds{30};
// This function is run before each worker thread begins consuming tasks.
- using OnCreateThreadFn = stdx::function<void(const std::string& threadName)>;
+ using OnCreateThreadFn = std::function<void(const std::string& threadName)>;
OnCreateThreadFn onCreateThread = [](const std::string&) {};
};
diff --git a/src/mongo/util/concurrency/thread_pool_test_common.cpp b/src/mongo/util/concurrency/thread_pool_test_common.cpp
index 2c2113bb890..2a2e1cacd3d 100644
--- a/src/mongo/util/concurrency/thread_pool_test_common.cpp
+++ b/src/mongo/util/concurrency/thread_pool_test_common.cpp
@@ -45,7 +45,7 @@
namespace mongo {
namespace {
-using ThreadPoolFactory = stdx::function<std::unique_ptr<ThreadPoolInterface>()>;
+using ThreadPoolFactory = std::function<std::unique_ptr<ThreadPoolInterface>()>;
class CommonThreadPoolTestFixture : public ThreadPoolTest {
public:
@@ -61,7 +61,7 @@ private:
};
using ThreadPoolTestCaseFactory =
- stdx::function<std::unique_ptr<::mongo::unittest::Test>(ThreadPoolFactory)>;
+ std::function<std::unique_ptr<::mongo::unittest::Test>(ThreadPoolFactory)>;
using ThreadPoolTestCaseMap = stdx::unordered_map<std::string, ThreadPoolTestCaseFactory>;
static ThreadPoolTestCaseMap& threadPoolTestCaseRegistry() {
@@ -200,7 +200,7 @@ COMMON_THREAD_POOL_TEST(PoolJoinExecutesRemainingTasks) {
COMMON_THREAD_POOL_TEST(RepeatedScheduleDoesntSmashStack) {
const std::size_t depth = 10000ul;
auto& pool = getThreadPool();
- stdx::function<void()> func;
+ std::function<void()> func;
std::size_t n = 0;
stdx::mutex mutex;
stdx::condition_variable condvar;
diff --git a/src/mongo/util/concurrency/thread_pool_test_common.h b/src/mongo/util/concurrency/thread_pool_test_common.h
index f70ffc40a20..abd9cdc5025 100644
--- a/src/mongo/util/concurrency/thread_pool_test_common.h
+++ b/src/mongo/util/concurrency/thread_pool_test_common.h
@@ -29,11 +29,10 @@
#pragma once
+#include <functional>
#include <memory>
#include <string>
-#include "mongo/stdx/functional.h"
-
namespace mongo {
class ThreadPoolInterface;
@@ -44,6 +43,6 @@ class ThreadPoolInterface;
* work against any implementation of ThreadPoolInterface.
*/
void addTestsForThreadPool(const std::string& suiteName,
- stdx::function<std::unique_ptr<ThreadPoolInterface>()> makeThreadPool);
+ std::function<std::unique_ptr<ThreadPoolInterface>()> makeThreadPool);
} // namespace mongo
diff --git a/src/mongo/util/decoration_registry.h b/src/mongo/util/decoration_registry.h
index 721d2a4077c..6e4f8ed55db 100644
--- a/src/mongo/util/decoration_registry.h
+++ b/src/mongo/util/decoration_registry.h
@@ -36,7 +36,6 @@
#include <vector>
#include "mongo/base/static_assert.h"
-#include "mongo/stdx/functional.h"
#include "mongo/util/decoration_container.h"
#include "mongo/util/scopeguard.h"
diff --git a/src/mongo/util/exit.cpp b/src/mongo/util/exit.cpp
index 9f198d91d7e..b08545f8c2d 100644
--- a/src/mongo/util/exit.cpp
+++ b/src/mongo/util/exit.cpp
@@ -34,10 +34,10 @@
#include "mongo/util/exit.h"
#include <boost/optional.hpp>
+#include <functional>
#include <stack>
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp
index 81da6d94723..a23a680c327 100644
--- a/src/mongo/util/fail_point.cpp
+++ b/src/mongo/util/fail_point.cpp
@@ -125,7 +125,7 @@ void FailPoint::disableFailPoint() {
}
FailPoint::RetCode FailPoint::slowShouldFailOpenBlock(
- stdx::function<bool(const BSONObj&)> cb) noexcept {
+ std::function<bool(const BSONObj&)> cb) noexcept {
ValType localFpInfo = _fpInfo.addAndFetch(1);
if ((localFpInfo & ACTIVE_BIT) == 0) {
diff --git a/src/mongo/util/fail_point.h b/src/mongo/util/fail_point.h
index 367eeab3632..f82d85785a5 100644
--- a/src/mongo/util/fail_point.h
+++ b/src/mongo/util/fail_point.h
@@ -29,11 +29,12 @@
#pragma once
+#include <functional>
+
#include "mongo/base/status_with.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/operation_context.h"
#include "mongo/platform/atomic_word.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
namespace mongo {
@@ -196,7 +197,7 @@ private:
* If a callable is passed, and returns false, this will return userIgnored and avoid altering
* the mode in any way. The argument is the fail point payload.
*/
- RetCode slowShouldFailOpenBlock(stdx::function<bool(const BSONObj&)> cb) noexcept;
+ RetCode slowShouldFailOpenBlock(std::function<bool(const BSONObj&)> cb) noexcept;
/**
* @return the stored BSONObj in this fail point. Note that this cannot be safely
diff --git a/src/mongo/util/fail_point_test.cpp b/src/mongo/util/fail_point_test.cpp
index c8f974d475f..2a759a5216a 100644
--- a/src/mongo/util/fail_point_test.cpp
+++ b/src/mongo/util/fail_point_test.cpp
@@ -31,11 +31,11 @@
#include "mongo/platform/basic.h"
+#include <functional>
#include <stdexcept>
#include <string>
#include <vector>
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/fail_point.h"
diff --git a/src/mongo/util/invalidating_lru_cache_test.cpp b/src/mongo/util/invalidating_lru_cache_test.cpp
index 150cae38792..9546091f061 100644
--- a/src/mongo/util/invalidating_lru_cache_test.cpp
+++ b/src/mongo/util/invalidating_lru_cache_test.cpp
@@ -31,10 +31,10 @@
#include "mongo/platform/basic.h"
-#include "boost/optional.hpp"
+#include <boost/optional.hpp>
+#include <functional>
#include "mongo/platform/atomic_word.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/future.h"
@@ -53,13 +53,13 @@ public:
_isValid.store(isValid);
}
- void setValidHook(stdx::function<bool()> validHook) {
+ void setValidHook(std::function<bool()> validHook) {
_isValidHook = std::move(validHook);
}
private:
AtomicWord<bool> _isValid{true};
- boost::optional<stdx::function<bool()>> _isValidHook;
+ boost::optional<std::function<bool()>> _isValidHook;
};
struct TestValueInvalidator {
diff --git a/src/mongo/util/lru_cache_test.cpp b/src/mongo/util/lru_cache_test.cpp
index ef24d708828..a8772bc5a93 100644
--- a/src/mongo/util/lru_cache_test.cpp
+++ b/src/mongo/util/lru_cache_test.cpp
@@ -141,7 +141,7 @@ void assertNotInCache(const LRUCache<K, V>& cache, const K& key) {
}
const std::array<int, 7> kTestSizes{1, 2, 3, 4, 5, 10, 1000};
-using SizedTest = stdx::function<void(int)>;
+using SizedTest = std::function<void(int)>;
void runWithDifferentSizes(SizedTest test) {
for (auto size : kTestSizes) {
mongo::unittest::log() << "\t\tTesting cache size of " << size;
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index 56b5911e3f6..441fcb3e763 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -158,7 +158,7 @@ std::string RFC4514Parser::extractAttributeName() {
StringBuilder sb;
auto ch = _cur();
- stdx::function<bool(char ch)> characterCheck;
+ std::function<bool(char ch)> characterCheck;
// If the first character is a digit, then this is an OID and can only contain
// numbers and '.'
if (isDigit(ch)) {
diff --git a/src/mongo/util/options_parser/options_parser.cpp b/src/mongo/util/options_parser/options_parser.cpp
index e888351b52c..462fccde4e2 100644
--- a/src/mongo/util/options_parser/options_parser.cpp
+++ b/src/mongo/util/options_parser/options_parser.cpp
@@ -76,7 +76,7 @@ namespace optionenvironment {
namespace po = boost::program_options;
namespace fs = boost::filesystem;
-stdx::function<bool()> OptionsParser::useStrict;
+std::function<bool()> OptionsParser::useStrict;
namespace {
diff --git a/src/mongo/util/options_parser/options_parser.h b/src/mongo/util/options_parser/options_parser.h
index 0ad3d74f6a7..0dcc5db5c15 100644
--- a/src/mongo/util/options_parser/options_parser.h
+++ b/src/mongo/util/options_parser/options_parser.h
@@ -29,12 +29,12 @@
#pragma once
+#include <functional>
#include <map>
#include <string>
#include <vector>
#include "mongo/base/status.h"
-#include "mongo/stdx/functional.h"
#include "mongo/util/duration.h"
namespace mongo {
@@ -95,7 +95,7 @@ public:
* true - unknown config options will generate an error during parsing.
* false - unknow config options will be ignored during parsing.
*/
- static stdx::function<bool()> useStrict;
+ static std::function<bool()> useStrict;
OptionsParser() {}
virtual ~OptionsParser() {}
diff --git a/src/mongo/util/periodic_runner.h b/src/mongo/util/periodic_runner.h
index a474fb0d6ad..1508078a87f 100644
--- a/src/mongo/util/periodic_runner.h
+++ b/src/mongo/util/periodic_runner.h
@@ -29,9 +29,9 @@
#pragma once
+#include <functional>
#include <string>
-#include "mongo/stdx/functional.h"
#include "mongo/util/time_support.h"
namespace mongo {
@@ -51,7 +51,7 @@ class Client;
*/
class PeriodicRunner {
public:
- using Job = stdx::function<void(Client* client)>;
+ using Job = std::function<void(Client* client)>;
struct PeriodicJob {
PeriodicJob(std::string name, Job callable, Milliseconds period)
diff --git a/src/mongo/util/queue.h b/src/mongo/util/queue.h
index 6cc79d5d47f..63321eeb926 100644
--- a/src/mongo/util/queue.h
+++ b/src/mongo/util/queue.h
@@ -30,12 +30,12 @@
#pragma once
#include <boost/optional.hpp>
+#include <functional>
#include <limits>
#include <queue>
#include "mongo/stdx/chrono.h"
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
namespace mongo {
@@ -54,7 +54,7 @@ class BlockingQueue {
BlockingQueue& operator=(const BlockingQueue&) = delete;
public:
- using GetSizeFn = stdx::function<size_t(const T&)>;
+ using GetSizeFn = std::function<size_t(const T&)>;
BlockingQueue() : BlockingQueue(std::numeric_limits<std::size_t>::max()) {}
BlockingQueue(size_t size) : BlockingQueue(size, [](const T&) { return 1; }) {}