]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1095] Fixed conditiona variable usage
authorFrancis Dupont <fdupont@isc.org>
Sat, 28 Mar 2020 12:34:44 +0000 (13:34 +0100)
committerRazvan Becheriu <razvan@isc.org>
Wed, 6 May 2020 09:46:31 +0000 (12:46 +0300)
src/hooks/dhcp/high_availability/tests/ha_test.cc

index 32b657460ad4468c6be9525eb762a828a8a1af70..8b4044ee770a61fe1d23f7e214e58e521023bcee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -130,10 +130,8 @@ HATest::testSynchronousCommands(std::function<void()> commands) {
 void
 HATest::signalServiceRunning(bool& running, std::mutex& mutex,
                              std::condition_variable& condvar) {
-    {
-        std::lock_guard<std::mutex> lock(mutex);
-        running = true;
-    }
+    std::lock_guard<std::mutex> lock(mutex);
+    running = true;
     condvar.notify_one();
 }