From 673ddc9d77c12556d228be7cfc0fb4fe381d6bd4 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 14 Apr 2020 20:23:06 +0300 Subject: [PATCH] Drop superfluous locking for atomic in DirectoryMonitor --- src/Storages/Distributed/DirectoryMonitor.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Storages/Distributed/DirectoryMonitor.cpp b/src/Storages/Distributed/DirectoryMonitor.cpp index 01bf0798a63..d21c2eb0d4c 100644 --- a/src/Storages/Distributed/DirectoryMonitor.cpp +++ b/src/Storages/Distributed/DirectoryMonitor.cpp @@ -100,10 +100,7 @@ StorageDistributedDirectoryMonitor::~StorageDistributedDirectoryMonitor() { if (!quit) { - { - quit = true; - std::lock_guard lock{mutex}; - } + quit = true; cond.notify_one(); thread.join(); } @@ -122,10 +119,7 @@ void StorageDistributedDirectoryMonitor::shutdownAndDropAllData() { if (!quit) { - { - quit = true; - std::lock_guard lock{mutex}; - } + quit = true; cond.notify_one(); thread.join(); }