From patchwork Wed Oct 21 15:41:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10178 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C05C5BDB13 for ; Wed, 21 Oct 2020 15:41:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7567560DF8; Wed, 21 Oct 2020 17:41:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="F33lSUez"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F04660986 for ; Wed, 21 Oct 2020 17:41:53 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 94BBAAEE; Wed, 21 Oct 2020 17:41:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603294913; bh=OtrTKmCaTvWBCtkRvw14X1FPLDeE3Sx+DMPQTrhPlqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F33lSUezrSzhCLr+/Dtrpg3Ly9YBYrq6bWKcYbVN36wF7nCJ2tp8G7erg7+3MpHqO FoY6Kmspb+6GiiahTg7SbM47Ul+SMTgULxhWtNkgjSaddSVydbZG3r1sQNeA224UAs mxmiQjPkThSYMmsBpFhC0nQ6zc7qHfeIl4HVKm2M= From: Kieran Bingham To: libcamera devel Date: Wed, 21 Oct 2020 16:41:34 +0100 Message-Id: <20201021154148.511505-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201021154148.511505-1-kieran.bingham@ideasonboard.com> References: <20201021154148.511505-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 01/15] libcamera: thread: Prevent shadowing of signal name X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The Thread::wait() function creates a boolean flag 'finished' which shadows the internal member signal of the same name. Rename the boolean flag to prevent confusion and shadowing of the signal. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp index 87006a9c4301..b5d7103ad341 100644 --- a/src/libcamera/thread.cpp +++ b/src/libcamera/thread.cpp @@ -374,7 +374,7 @@ void Thread::exit(int code) */ bool Thread::wait(utils::duration duration) { - bool finished = true; + bool hasFinished = true; { MutexLocker locker(data_->mutex_); @@ -382,14 +382,14 @@ bool Thread::wait(utils::duration duration) if (duration == utils::duration::max()) data_->cv_.wait(locker, [&]() { return !data_->running_; }); else - finished = data_->cv_.wait_for(locker, duration, - [&]() { return !data_->running_; }); + hasFinished = data_->cv_.wait_for(locker, duration, + [&]() { return !data_->running_; }); } if (thread_.joinable()) thread_.join(); - return finished; + return hasFinished; } /**