diff options
Diffstat (limited to 'src/mongo/util/concurrency')
-rw-r--r-- | src/mongo/util/concurrency/idle_thread_block.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/mutex.h | 2 | ||||
-rw-r--r-- | src/mongo/util/concurrency/thread_name.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/thread_pool.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/concurrency/ticketholder.cpp | 5 | ||||
-rw-r--r-- | src/mongo/util/concurrency/value.h | 2 |
6 files changed, 10 insertions, 11 deletions
diff --git a/src/mongo/util/concurrency/idle_thread_block.cpp b/src/mongo/util/concurrency/idle_thread_block.cpp index 2886a24edd7..64426a47774 100644 --- a/src/mongo/util/concurrency/idle_thread_block.cpp +++ b/src/mongo/util/concurrency/idle_thread_block.cpp @@ -36,7 +36,7 @@ namespace mongo { namespace for_debuggers { // This needs external linkage to ensure that debuggers can use it. thread_local const char* idleThreadLocation = nullptr; -} +} // namespace for_debuggers using for_debuggers::idleThreadLocation; void IdleThreadBlock::beginIdleThreadBlock(const char* location) { @@ -48,4 +48,4 @@ void IdleThreadBlock::endIdleThreadBlock() { invariant(idleThreadLocation); idleThreadLocation = nullptr; } -} +} // namespace mongo diff --git a/src/mongo/util/concurrency/mutex.h b/src/mongo/util/concurrency/mutex.h index 30ee48f8a30..f252fe14cd8 100644 --- a/src/mongo/util/concurrency/mutex.h +++ b/src/mongo/util/concurrency/mutex.h @@ -44,7 +44,7 @@ namespace mongo { * timeout). Thus it can be implemented using OS-specific * facilities in all environments (if desired). On Windows, * the implementation below is faster than boost mutex. -*/ + */ #if defined(_WIN32) class SimpleMutex { diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp index 7aa58a3b6f4..03a6ab181c4 100644 --- a/src/mongo/util/concurrency/thread_name.cpp +++ b/src/mongo/util/concurrency/thread_name.cpp @@ -145,8 +145,8 @@ void setThreadName(StringData name) { // limit, it's best to shorten long names. int error = 0; if (threadName.size() > 15) { - std::string shortName = str::stream() << threadName.substr(0, 7) << '.' - << threadName.substr(threadName.size() - 7); + std::string shortName = str::stream() + << threadName.substr(0, 7) << '.' << threadName.substr(threadName.size() - 7); error = pthread_setname_np(pthread_self(), shortName.c_str()); } else { error = pthread_setname_np(pthread_self(), threadName.rawData()); diff --git a/src/mongo/util/concurrency/thread_pool.cpp b/src/mongo/util/concurrency/thread_pool.cpp index 69e4e0f64b3..fd8d23377ea 100644 --- a/src/mongo/util/concurrency/thread_pool.cpp +++ b/src/mongo/util/concurrency/thread_pool.cpp @@ -173,8 +173,8 @@ void ThreadPool::_drainPendingTasks() { // Tasks cannot be run inline because they can create OperationContexts and the join() caller // may already have one associated with the thread. stdx::thread cleanThread = stdx::thread([&] { - const std::string threadName = str::stream() << _options.threadNamePrefix - << _nextThreadId++; + const std::string threadName = str::stream() + << _options.threadNamePrefix << _nextThreadId++; setThreadName(threadName); _options.onCreateThread(threadName); stdx::unique_lock<stdx::mutex> lock(_mutex); diff --git a/src/mongo/util/concurrency/ticketholder.cpp b/src/mongo/util/concurrency/ticketholder.cpp index d836f977b67..e30746807ae 100644 --- a/src/mongo/util/concurrency/ticketholder.cpp +++ b/src/mongo/util/concurrency/ticketholder.cpp @@ -137,8 +137,7 @@ Status TicketHolder::resize(int newSize) { if (newSize > SEM_VALUE_MAX) return Status(ErrorCodes::BadValue, str::stream() << "Maximum value for semaphore is " << SEM_VALUE_MAX - << "; given " - << newSize); + << "; given " << newSize); while (_outof.load() < newSize) { release(); @@ -254,4 +253,4 @@ bool TicketHolder::_tryAcquire() { return true; } #endif -} +} // namespace mongo diff --git a/src/mongo/util/concurrency/value.h b/src/mongo/util/concurrency/value.h index b2759be742a..a0a03d9d260 100644 --- a/src/mongo/util/concurrency/value.h +++ b/src/mongo/util/concurrency/value.h @@ -79,4 +79,4 @@ public: // multiple operations bool operator==(const std::string& s) const; }; -} +} // namespace mongo |