diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-27 12:21:37 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-28 10:13:21 -0400 |
commit | f922827d45ce752e148185dfa3a785f7c9cf29fd (patch) | |
tree | b3ae7fdba18d9ef3384af6e0d009d091e5df14a3 /src/mongo/util/concurrency | |
parent | f2f422d92b639edba0a10d40a43803723cb15baf (diff) | |
download | mongo-f922827d45ce752e148185dfa3a785f7c9cf29fd.tar.gz |
SERVER-40357 expand all calls to MONGO_DISALLOW_COPYING
produced by:
hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )"
for f in "$hits"; do
sed -i.orig '
s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/;
' $f
done
Diffstat (limited to 'src/mongo/util/concurrency')
-rw-r--r-- | src/mongo/util/concurrency/idle_thread_block.h | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/mutex.h | 7 | ||||
-rw-r--r-- | src/mongo/util/concurrency/spin_lock.h | 10 | ||||
-rw-r--r-- | src/mongo/util/concurrency/thread_pool.h | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/thread_pool_interface.h | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/thread_pool_test_common.cpp | 6 | ||||
-rw-r--r-- | src/mongo/util/concurrency/ticketholder.h | 7 |
7 files changed, 24 insertions, 18 deletions
diff --git a/src/mongo/util/concurrency/idle_thread_block.h b/src/mongo/util/concurrency/idle_thread_block.h index a395012d30a..ae1fcb96ff2 100644 --- a/src/mongo/util/concurrency/idle_thread_block.h +++ b/src/mongo/util/concurrency/idle_thread_block.h @@ -31,7 +31,6 @@ #include <boost/preprocessor/stringize.hpp> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -44,7 +43,8 @@ namespace mongo { * idle. */ class IdleThreadBlock { - MONGO_DISALLOW_COPYING(IdleThreadBlock); + IdleThreadBlock(const IdleThreadBlock&) = delete; + IdleThreadBlock& operator=(const IdleThreadBlock&) = delete; public: IdleThreadBlock(const char* location) { diff --git a/src/mongo/util/concurrency/mutex.h b/src/mongo/util/concurrency/mutex.h index 4e47c4e6df6..8674fe269a4 100644 --- a/src/mongo/util/concurrency/mutex.h +++ b/src/mongo/util/concurrency/mutex.h @@ -35,7 +35,6 @@ #include <pthread.h> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/util/assert_util.h" namespace mongo { @@ -49,7 +48,8 @@ namespace mongo { #if defined(_WIN32) class SimpleMutex { - MONGO_DISALLOW_COPYING(SimpleMutex); + SimpleMutex(const SimpleMutex&) = delete; + SimpleMutex& operator=(const SimpleMutex&) = delete; public: SimpleMutex() { @@ -74,7 +74,8 @@ private: #else class SimpleMutex { - MONGO_DISALLOW_COPYING(SimpleMutex); + SimpleMutex(const SimpleMutex&) = delete; + SimpleMutex& operator=(const SimpleMutex&) = delete; public: SimpleMutex() { diff --git a/src/mongo/util/concurrency/spin_lock.h b/src/mongo/util/concurrency/spin_lock.h index 38854fef457..7f237dc3175 100644 --- a/src/mongo/util/concurrency/spin_lock.h +++ b/src/mongo/util/concurrency/spin_lock.h @@ -35,7 +35,6 @@ #include <atomic> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/config.h" #include "mongo/platform/compiler.h" #include "mongo/stdx/mutex.h" @@ -44,7 +43,8 @@ namespace mongo { #if defined(_WIN32) class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() { @@ -71,7 +71,8 @@ private: #if MONGO_CONFIG_DEBUG_BUILD class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() = default; @@ -91,7 +92,8 @@ private: #else class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() = default; diff --git a/src/mongo/util/concurrency/thread_pool.h b/src/mongo/util/concurrency/thread_pool.h index b95956c4832..370de65056e 100644 --- a/src/mongo/util/concurrency/thread_pool.h +++ b/src/mongo/util/concurrency/thread_pool.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/mutex.h" @@ -51,7 +50,8 @@ class Status; * See the Options struct for information about how to configure an instance. */ class ThreadPool final : public ThreadPoolInterface { - MONGO_DISALLOW_COPYING(ThreadPool); + ThreadPool(const ThreadPool&) = delete; + ThreadPool& operator=(const ThreadPool&) = delete; public: /** diff --git a/src/mongo/util/concurrency/thread_pool_interface.h b/src/mongo/util/concurrency/thread_pool_interface.h index dde15644cb2..847dfe0506b 100644 --- a/src/mongo/util/concurrency/thread_pool_interface.h +++ b/src/mongo/util/concurrency/thread_pool_interface.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/functional.h" namespace mongo { @@ -40,7 +39,8 @@ class Status; * Interface for a thread pool. */ class ThreadPoolInterface { - MONGO_DISALLOW_COPYING(ThreadPoolInterface); + ThreadPoolInterface(const ThreadPoolInterface&) = delete; + ThreadPoolInterface& operator=(const ThreadPoolInterface&) = delete; public: using Task = unique_function<void()>; diff --git a/src/mongo/util/concurrency/thread_pool_test_common.cpp b/src/mongo/util/concurrency/thread_pool_test_common.cpp index 5df135ac19c..a03da59cd49 100644 --- a/src/mongo/util/concurrency/thread_pool_test_common.cpp +++ b/src/mongo/util/concurrency/thread_pool_test_common.cpp @@ -70,7 +70,8 @@ static ThreadPoolTestCaseMap& threadPoolTestCaseRegistry() { } class TptRegistrationAgent { - MONGO_DISALLOW_COPYING(TptRegistrationAgent); + TptRegistrationAgent(const TptRegistrationAgent&) = delete; + TptRegistrationAgent& operator=(const TptRegistrationAgent&) = delete; public: TptRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) { @@ -85,7 +86,8 @@ public: template <typename T> class TptDeathRegistrationAgent { - MONGO_DISALLOW_COPYING(TptDeathRegistrationAgent); + TptDeathRegistrationAgent(const TptDeathRegistrationAgent&) = delete; + TptDeathRegistrationAgent& operator=(const TptDeathRegistrationAgent&) = delete; public: TptDeathRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) { diff --git a/src/mongo/util/concurrency/ticketholder.h b/src/mongo/util/concurrency/ticketholder.h index 53a70e8f914..51c232bc5d1 100644 --- a/src/mongo/util/concurrency/ticketholder.h +++ b/src/mongo/util/concurrency/ticketholder.h @@ -32,7 +32,6 @@ #include <semaphore.h> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/db/operation_context.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -42,7 +41,8 @@ namespace mongo { class TicketHolder { - MONGO_DISALLOW_COPYING(TicketHolder); + TicketHolder(const TicketHolder&) = delete; + TicketHolder& operator=(const TicketHolder&) = delete; public: explicit TicketHolder(int num); @@ -113,7 +113,8 @@ private: }; class TicketHolderReleaser { - MONGO_DISALLOW_COPYING(TicketHolderReleaser); + TicketHolderReleaser(const TicketHolderReleaser&) = delete; + TicketHolderReleaser& operator=(const TicketHolderReleaser&) = delete; public: TicketHolderReleaser() { |