diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-06-18 11:18:11 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-06-18 15:32:33 -0400 |
commit | 9bb8d65d8d6c58fa325e81ad8f0d7d067a66f413 (patch) | |
tree | 516cf7fbefc28e3cf925a084f873e8af985543e9 /src/mongo/db | |
parent | 94543115f64345f3bb74b2508b1b319d6b6cf68d (diff) | |
download | mongo-9bb8d65d8d6c58fa325e81ad8f0d7d067a66f413.tar.gz |
SERVER-18723 boost -> stdx for condition_variable
Diffstat (limited to 'src/mongo/db')
20 files changed, 45 insertions, 49 deletions
diff --git a/src/mongo/db/auth/authorization_manager.h b/src/mongo/db/auth/authorization_manager.h index d168fdf8eec..8f7afa9f3fc 100644 --- a/src/mongo/db/auth/authorization_manager.h +++ b/src/mongo/db/auth/authorization_manager.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/thread/condition_variable.hpp> #include <memory> #include <string> @@ -45,6 +44,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" #include "mongo/platform/unordered_map.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/mutex.h" @@ -406,7 +406,7 @@ namespace mongo { * Condition used to signal that it is OK for another CacheGuard to enter a fetch phase. * Manipulated via CacheGuard. */ - boost::condition_variable _fetchPhaseIsReady; + stdx::condition_variable _fetchPhaseIsReady; }; } // namespace mongo diff --git a/src/mongo/db/auth/user_cache_invalidator_job.cpp b/src/mongo/db/auth/user_cache_invalidator_job.cpp index 557214e0fd7..0faaaa84bc6 100644 --- a/src/mongo/db/auth/user_cache_invalidator_job.cpp +++ b/src/mongo/db/auth/user_cache_invalidator_job.cpp @@ -54,7 +54,7 @@ namespace { // How often to check with the config servers whether authorization information has changed. int userCacheInvalidationIntervalSecs = 30; // 30 second default stdx::mutex invalidationIntervalMutex; - boost::condition_variable invalidationIntervalChangedCondition; + stdx::condition_variable invalidationIntervalChangedCondition; Date_t lastInvalidationTime; class ExportedInvalidationIntervalParameter : public ExportedServerParameter<int> { diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index 2d492a103b4..fbf46736f98 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -36,6 +36,7 @@ #include <string> #include "mongo/base/disallow_copying.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/thread.h" #include "mongo/util/assert_util.h" #include "mongo/util/map_util.h" @@ -61,7 +62,7 @@ namespace { private: int _opsInProgCount; - boost::condition_variable _noOpsInProg; + stdx::condition_variable _noOpsInProg; }; typedef StringMap<std::shared_ptr<BgInfo> > BgInfoMap; diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index 90418dce52d..a8b19391d3c 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -30,7 +30,6 @@ #include "mongo/db/commands/fsync.h" -#include <boost/thread/condition.hpp> #include <iostream> #include <sstream> #include <string> @@ -45,13 +44,14 @@ #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/auth/privilege.h" -#include "mongo/db/concurrency/d_concurrency.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" +#include "mongo/db/concurrency/d_concurrency.h" +#include "mongo/db/operation_context_impl.h" #include "mongo/db/service_context.h" #include "mongo/db/storage/mmap_v1/dur.h" #include "mongo/db/storage/storage_engine.h" -#include "mongo/db/client.h" -#include "mongo/db/operation_context_impl.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/util/background.h" #include "mongo/util/log.h" @@ -89,8 +89,8 @@ namespace mongo { SimpleMutex m; // protects locked var above string err; - boost::condition _threadSync; - boost::condition _unlockSync; + stdx::condition_variable_any _threadSync; + stdx::condition_variable_any _unlockSync; FSyncCommand() : Command( "fsync" ), m("lockfsync") { locked=false; pendingUnlock=false; } virtual bool isWriteCommandForConfigServer() const { return false; } diff --git a/src/mongo/db/concurrency/lock_manager.h b/src/mongo/db/concurrency/lock_manager.h index a73d57232f3..1d8c054152b 100644 --- a/src/mongo/db/concurrency/lock_manager.h +++ b/src/mongo/db/concurrency/lock_manager.h @@ -28,8 +28,6 @@ #pragma once -#include <boost/thread/condition_variable.hpp> - #include <deque> #include "mongo/config.h" @@ -39,6 +37,7 @@ #include "mongo/platform/compiler.h" #include "mongo/platform/cstdint.h" #include "mongo/platform/unordered_map.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/util/concurrency/mutex.h" diff --git a/src/mongo/db/concurrency/lock_state.h b/src/mongo/db/concurrency/lock_state.h index b179ae28e80..ca16767eb49 100644 --- a/src/mongo/db/concurrency/lock_state.h +++ b/src/mongo/db/concurrency/lock_state.h @@ -63,7 +63,7 @@ namespace mongo { // These two go together to implement the conditional variable pattern. stdx::mutex _mutex; - boost::condition_variable _cond; + stdx::condition_variable _cond; // Result from the last call to notify LockResult _result; diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index ae60503cf7b..9a7927ba0b9 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -57,7 +57,7 @@ namespace { // parent thread has not yet synchronized with it. bool _bgIndexStarting(false); stdx::mutex _bgIndexStartingMutex; - boost::condition_variable _bgIndexStartingCondVar; + stdx::condition_variable _bgIndexStartingCondVar; void _setBgIndexStarting() { stdx::lock_guard<stdx::mutex> lk(_bgIndexStartingMutex); diff --git a/src/mongo/db/range_deleter.h b/src/mongo/db/range_deleter.h index 4d9db11dd74..db56a86576b 100644 --- a/src/mongo/db/range_deleter.h +++ b/src/mongo/db/range_deleter.h @@ -211,13 +211,13 @@ namespace mongo { // No delete is in progress. Used to make sure that there is no activity // in this deleter, and therefore is safe to destroy it. Must be used in // conjunction with _stopRequested. - boost::condition _nothingInProgressCV; + stdx::condition_variable _nothingInProgressCV; // Protects all the data structure below this. mutable mutex _queueMutex; // _taskQueue has a task ready to work on. - boost::condition _taskQueueNotEmptyCV; + stdx::condition_variable _taskQueueNotEmptyCV; // Queue for storing the list of ranges that have cursors pending on it. // diff --git a/src/mongo/db/range_deleter_mock_env.h b/src/mongo/db/range_deleter_mock_env.h index 02eebb341ab..b4892b99f70 100644 --- a/src/mongo/db/range_deleter_mock_env.h +++ b/src/mongo/db/range_deleter_mock_env.h @@ -147,13 +147,13 @@ namespace mongo { // Protects _pauseDelete & _pausedCount mutex _pauseDeleteMutex; - boost::condition _pausedCV; + stdx::condition_variable _pausedCV; bool _pauseDelete; // Number of times a delete gets paused. uint64_t _pausedCount; // _pausedCount < nthPause (used by waitForNthPausedDelete) - boost::condition _pausedDeleteChangeCV; + stdx::condition_variable _pausedDeleteChangeCV; // Protects all variables below this line. mutex _envStatMutex; @@ -161,6 +161,6 @@ namespace mongo { // Keeps track of the number of times getCursorIds was called. uint64_t _getCursorsCallCount; // _getCursorsCallCount < nthCall (used by waitForNthGetCursor) - boost::condition _cursorsCallCountUpdatedCV; + stdx::condition_variable _cursorsCallCountUpdatedCV; }; } diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h index ee14d380fe9..d1e7e7ea692 100644 --- a/src/mongo/db/repl/bgsync.h +++ b/src/mongo/db/repl/bgsync.h @@ -28,11 +28,10 @@ #pragma once -#include <boost/thread/condition.hpp> - #include "mongo/db/jsobj.h" #include "mongo/db/repl/oplogreader.h" #include "mongo/db/repl/optime.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/util/queue.h" @@ -152,9 +151,9 @@ namespace repl { // if produce thread should be running bool _pause; - boost::condition _pausedCondition; + stdx::condition_variable _pausedCondition; bool _appliedBuffer; - boost::condition _appliedBufferCondition; + stdx::condition_variable _appliedBufferCondition; HostAndPort _syncSourceHost; diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index 8e240ecc6dc..5b3d48fbc21 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -104,7 +104,7 @@ namespace { // Synchronizes the section where a new Timestamp is generated and when it actually // appears in the oplog. mongo::mutex newOpMutex; - boost::condition newTimestampNotifier; + stdx::condition_variable newTimestampNotifier; static std::string _oplogCollectionName; diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.h b/src/mongo/db/repl/replication_coordinator_external_state_mock.h index 117e33cd2a4..1602601a33a 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_mock.h +++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/thread/condition.hpp> #include <vector> #include "mongo/base/disallow_copying.h" @@ -38,6 +37,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/repl/last_vote.h" #include "mongo/db/repl/replication_coordinator_external_state.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/thread.h" #include "mongo/util/net/hostandport.h" @@ -132,10 +132,10 @@ namespace repl { Status _storeLocalLastVoteDocumentStatus; // mutex and cond var for controlling stroeLocalConfigDocument()'s hanging stdx::mutex _shouldHangConfigMutex; - boost::condition _shouldHangConfigCondVar; + stdx::condition_variable _shouldHangConfigCondVar; // mutex and cond var for controlling stroeLocalLastVoteDocument()'s hanging stdx::mutex _shouldHangLastVoteMutex; - boost::condition _shouldHangLastVoteCondVar; + stdx::condition_variable _shouldHangLastVoteCondVar; bool _storeLocalConfigDocumentShouldHang; bool _storeLocalLastVoteDocumentShouldHang; bool _connectionsClosed; diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index af29e984e7e..83adf16fdde 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -121,7 +121,7 @@ namespace { unsigned int _opID, const OpTime* _opTime, const WriteConcernOptions* _writeConcern, - boost::condition_variable* _condVar) : list(_list), + stdx::condition_variable* _condVar) : list(_list), master(true), opID(_opID), opTime(_opTime), @@ -139,7 +139,7 @@ namespace { const unsigned int opID; const OpTime* opTime; const WriteConcernOptions* writeConcern; - boost::condition_variable* condVar; + stdx::condition_variable* condVar; }; namespace { @@ -820,7 +820,7 @@ namespace { duration_cast<Milliseconds>(elapsedTime)); } - boost::condition_variable condVar; + stdx::condition_variable condVar; WaiterInfo waitInfo(&_opTimeWaiterList, txn->getOpID(), &ts, @@ -1102,7 +1102,7 @@ namespace { } // Must hold _mutex before constructing waitInfo as it will modify _replicationWaiterList - boost::condition_variable condVar; + stdx::condition_variable condVar; WaiterInfo waitInfo( &_replicationWaiterList, txn->getOpID(), &opTime, &writeConcern, &condVar); while (!_doneWaitingForReplication_inlock(opTime, writeConcern)) { diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h index 2c53a92e936..8fcd9671dae 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.h +++ b/src/mongo/db/repl/replication_coordinator_impl.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/thread/condition_variable.hpp> #include <vector> #include <memory> @@ -47,6 +46,7 @@ #include "mongo/platform/atomic_word.h" #include "mongo/platform/unordered_map.h" #include "mongo/platform/unordered_set.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/stdx/thread.h" #include "mongo/util/net/hostandport.h" @@ -982,7 +982,7 @@ namespace repl { bool _isWaitingForDrainToComplete; // (M) // Used to signal threads waiting for changes to _rsConfigState. - boost::condition_variable _rsConfigStateChange; // (M) + stdx::condition_variable _rsConfigStateChange; // (M) // Represents the configuration state of the coordinator, which controls how and when // _rsConfig may change. See the state transition diagram in the type definition of diff --git a/src/mongo/db/repl/replication_executor.h b/src/mongo/db/repl/replication_executor.h index 6574bdef3c6..a6749bb26a4 100644 --- a/src/mongo/db/repl/replication_executor.h +++ b/src/mongo/db/repl/replication_executor.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/thread/condition_variable.hpp> #include <string> #include <thread> @@ -42,6 +41,7 @@ #include "mongo/executor/task_executor.h" #include "mongo/platform/compiler.h" #include "mongo/platform/random.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/list.h" #include "mongo/stdx/mutex.h" @@ -306,7 +306,7 @@ namespace repl { std::unique_ptr<StorageInterface> _storageInterface; stdx::mutex _mutex; stdx::mutex _terribleExLockSyncMutex; - boost::condition_variable _noMoreWaitingThreads; + stdx::condition_variable _noMoreWaitingThreads; WorkQueue _freeQueue; WorkQueue _readyQueue; WorkQueue _dbWorkInProgressQueue; @@ -398,7 +398,7 @@ namespace repl { // All members other than _executor are protected by the executor's _mutex. bool _isSignaled; - boost::condition_variable _isSignaledCondition; + stdx::condition_variable _isSignaledCondition; EventList::iterator _iter; WorkQueue _waiters; }; diff --git a/src/mongo/db/repl/sync_source_feedback.h b/src/mongo/db/repl/sync_source_feedback.h index 900019cd3e8..ebbd55b1dbf 100644 --- a/src/mongo/db/repl/sync_source_feedback.h +++ b/src/mongo/db/repl/sync_source_feedback.h @@ -29,10 +29,9 @@ #pragma once -#include <boost/thread/condition.hpp> - #include "mongo/client/constants.h" #include "mongo/client/dbclientcursor.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/util/net/hostandport.h" @@ -85,7 +84,7 @@ namespace repl { // protects cond, _shutdownSignaled, and _positionChanged. stdx::mutex _mtx; // used to alert our thread of changes which need to be passed up the chain - boost::condition _cond; + stdx::condition_variable _cond; // used to indicate a position change which has not yet been pushed along bool _positionChanged; // Once this is set to true the _run method will terminate diff --git a/src/mongo/db/repl/task_runner.h b/src/mongo/db/repl/task_runner.h index 35e707c6905..33e879e08b8 100644 --- a/src/mongo/db/repl/task_runner.h +++ b/src/mongo/db/repl/task_runner.h @@ -28,10 +28,10 @@ #pragma once -#include <boost/thread/condition.hpp> #include <list> #include "mongo/base/disallow_copying.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/mutex.h" @@ -149,7 +149,7 @@ namespace repl { // Protects member data of this TaskRunner. mutable stdx::mutex _mutex; - boost::condition _condition; + stdx::condition_variable _condition; // _active is true when there are scheduled tasks in the task queue or // when a task is being run by the task runner. diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp index 24fec0eca41..ec76e172bc5 100644 --- a/src/mongo/db/storage/mmap_v1/dur.cpp +++ b/src/mongo/db/storage/mmap_v1/dur.cpp @@ -73,8 +73,6 @@ #include "mongo/db/storage/mmap_v1/dur.h" -#include <boost/thread/condition_variable.hpp> - #include <iomanip> #include <utility> @@ -91,6 +89,7 @@ #include "mongo/db/storage/mmap_v1/durable_mapped_file.h" #include "mongo/db/storage/mmap_v1/mmap_v1_options.h" #include "mongo/db/storage_options.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/stdx/thread.h" #include "mongo/util/concurrency/synchronization.h" @@ -115,7 +114,7 @@ namespace { // Used to activate the flush thread stdx::mutex flushMutex; - boost::condition_variable flushRequested; + stdx::condition_variable flushRequested; // This is waited on for getlasterror acknowledgements. It means that data has been written to // the journal, but not necessarily applied to the shared view, so it is all right to diff --git a/src/mongo/db/storage/mmap_v1/file_allocator.h b/src/mongo/db/storage/mmap_v1/file_allocator.h index cb987b21618..d42850f1aa0 100644 --- a/src/mongo/db/storage/mmap_v1/file_allocator.h +++ b/src/mongo/db/storage/mmap_v1/file_allocator.h @@ -31,8 +31,8 @@ #include <list> #include <boost/filesystem/path.hpp> -#include <boost/thread/condition.hpp> +#include "mongo/stdx/condition_variable.h" #include "mongo/util/concurrency/mutex.h" namespace mongo { @@ -92,7 +92,7 @@ namespace mongo { std::string makeTempFileName( boost::filesystem::path root ); mutable mongo::mutex _pendingMutex; - mutable boost::condition _pendingUpdated; + mutable stdx::condition_variable _pendingUpdated; std::list< std::string > _pending; mutable std::map< std::string, long > _pendingSize; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp index 19a128b7b98..4c71b448804 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp @@ -30,8 +30,6 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage -#include <boost/thread/condition.hpp> - #include "mongo/base/checked_cast.h" #include "mongo/base/init.h" #include "mongo/bson/bsonobjbuilder.h" @@ -40,6 +38,7 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h" #include "mongo/db/storage/wiredtiger/wiredtiger_session_cache.h" #include "mongo/db/storage/wiredtiger/wiredtiger_util.h" +#include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/util/concurrency/ticketholder.h" #include "mongo/util/log.h" @@ -74,7 +73,7 @@ namespace mongo { AtomicUInt32 numWaitingForSync; stdx::mutex mutex; // this just protects lastSyncTime - boost::condition condvar; + stdx::condition_variable condvar; long long lastSyncTime; } waitUntilDurableData; } |