From d6c4cb231467b1d90210b64be6727126a747679a Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 9 Sep 2019 12:33:50 +0300 Subject: [PATCH] use std::lock_guard whenever possible --- src/lib/dhcpsrv/thread_pool.h | 1 - src/lib/util/lock_guard.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/dhcpsrv/thread_pool.h b/src/lib/dhcpsrv/thread_pool.h index bcf98f8b9e..826a962ec3 100644 --- a/src/lib/dhcpsrv/thread_pool.h +++ b/src/lib/dhcpsrv/thread_pool.h @@ -53,7 +53,6 @@ struct ThreadPoolQueue { bool get(WorkItem& item) { std::unique_lock lock(mutex_); - while (!exit_) { if (queue_.empty()) { // Wait for add() or destroy(). diff --git a/src/lib/util/lock_guard.h b/src/lib/util/lock_guard.h index c656e035ca..11e3699b77 100644 --- a/src/lib/util/lock_guard.h +++ b/src/lib/util/lock_guard.h @@ -1,3 +1,22 @@ +// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2017-2019 Deutsche Telekom AG. +// +// Authors: Andrei Pavel +// Cristian Secareanu +// Razvan Becheriu +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #ifndef LOCK_GUARD_H #define LOCK_GUARD_H -- 2.47.2