From patchwork Fri Jun 11 23:33:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 458525 Delivered-To: patch@linaro.org Received: by 2002:a17:907:7409:0:0:0:0 with SMTP id gj9csp700273ejc; Fri, 11 Jun 2021 16:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmwRjMIxWsmMYxs/ii41vVpxINxzscyo1g95o8x0WITqYJQas5Cmf53v7shG9BIv/+CYDF X-Received: by 2002:a5e:c64c:: with SMTP id s12mr4839649ioo.3.1623454533576; Fri, 11 Jun 2021 16:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623454533; cv=none; d=google.com; s=arc-20160816; b=ktlvPXuszSX2/owhDXwS0J4o55+0l4oYdYxtYZILuoD89rKRBv9+HMbpzbh1e0esw/ p1Tq+P1PHiw4iwNEx8boQ2113CJFc9E0kP+A77OsMunIRIryyyL8KzC82kNJvq7byrk4 kRYYC8T9QlvB8Lt04qj88Lf+zCiCU1aapmSN8WaQhFyOlNoJCPo3fjho+45Zss5OAkpl 6IrkIcpjcreWCgK21fa5FZUEJYfcV0NmxxAeHi/flUjuhsxBe9NVZsVizRf4LZux2Gus 4y1ryC5NKj7h9nseG/X4vscaC8D7nm/eQxhsyFgIs3hsgV6wAWWRj1DHDi78s+5W9kSa ut5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QwcLIow8ryYHhtEXT5F43ejpzVNyBb+0Qw4NSoljESU=; b=SLPlm+1CDq3MfuoXNr4Vj8Yuq+KZp6zau/qs/Ig8umku0rvZb/hQI/1d2EuH581aSM QIHEyYt1r8oklErx2vbidosyJ38QNrFEKwRwLm1b5j2D7gKhnNUiaw1VTPWTHdpQMIrc wO2eCcJ1fq00jgPpoo0E6l9r6azmTZ2Yek1nQFRVICGBwZu8ATgWC3/T+E1N0BLdxmiN PUlI1IcnkVxBkCE93jnFVLd/l+ib5PsT3urxx6WW7aSq8C8wydN4IeXlR7zCBXV6DlbD 4W4tBbI4/NF6e7VqtFuilgKe1UnTmuEF47sYMOtS8t/yvrHMgnBZymb7GZFqyPExcrkN 8laA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GiQxpIHm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o192si8146280jao.55.2021.06.11.16.35.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jun 2021 16:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GiQxpIHm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrqgW-0004LR-TQ for patch@linaro.org; Fri, 11 Jun 2021 19:35:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrqex-0004Hr-1B for qemu-devel@nongnu.org; Fri, 11 Jun 2021 19:33:55 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:38404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrqeu-0006Q6-2v for qemu-devel@nongnu.org; Fri, 11 Jun 2021 19:33:53 -0400 Received: by mail-pg1-x52e.google.com with SMTP id t17so3667574pga.5 for ; Fri, 11 Jun 2021 16:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QwcLIow8ryYHhtEXT5F43ejpzVNyBb+0Qw4NSoljESU=; b=GiQxpIHmT416Vyivq/T1qh334fJp+gTS+XNUzD6HvetHXVKysVv0c00u91HQwgCg0H TksbrN3Efo6RfyLnV6hFRzBYfTJAec8fgJ6WHBltafRTAS+yyh+bDjZEqsJK6tYpcqXB 3iGjG+95pAPZukqPhuFhiwKNsG0Y08Nz8dgpAO1UN7nHQwJSa069o6xQhcUOzUwnTD6V YwU4N+rX8inNLvWLP0/rQZlBOE6P3rJB+vlw06/HDYXxK3Hv2jeI0CJNN5hmr583aW4a 6nbkFPwtLUQE67NHo+QECsG4B0Qz6hStLzVYRCIwBU57Anc4hV4xwEHuZ94ZfKCSJ1yY 2Rfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QwcLIow8ryYHhtEXT5F43ejpzVNyBb+0Qw4NSoljESU=; b=Hpdk1yN4VmkXEw0fH71ngE2WxljeRCyfopxIdSeUcOY4DMsgI4nXU+ZElRPQspubnA Znf2EbJ7txLnKpcpM2lJQBSdC0gzF3q1NvdGqEvs51+oSL0HgpFxbCDC3qVwvLikqxsl jmWc995/OQEt13oBNhRQJaWvh1XqVUdSajLUVeVSSviQ0k1jvOtglmMxbBxuYP/Q3gOr 6ll/PBHUkVRAaRaIR6W/bYIXIXTr9mOZuST6ESx0EilEZNa6kRuApdLJmdQqEqfD1dNx lmQwOcYdoWE8wQ7B94OhjYhN/4x3U1CslroL5Tkyn0vyKCTHctBRTwlvC83DZ5yGOqX2 7jzA== X-Gm-Message-State: AOAM530cKyK8RiM86lf+Pa+cPE4CxI4i30wETFIFt0sxTqfOp131/Pvg DH9EvtAY/ohS4N7X/lzuPLSVy8SWgaCoCg== X-Received: by 2002:aa7:9f43:0:b029:2f1:c336:8ac8 with SMTP id h3-20020aa79f430000b02902f1c3368ac8mr10697618pfr.11.1623454430679; Fri, 11 Jun 2021 16:33:50 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id m134sm6349606pfd.148.2021.06.11.16.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 16:33:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/8] util: Pass file+line to qemu_rec_mutex_unlock_impl Date: Fri, 11 Jun 2021 16:33:43 -0700 Message-Id: <20210611233347.653129-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611233347.653129-1-richard.henderson@linaro.org> References: <20210611233347.653129-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, thuth@redhat.com, ehabkost@redhat.com, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Create macros for file+line expansion in qemu_rec_mutex_unlock like we have for qemu_mutex_unlock. Signed-off-by: Richard Henderson --- include/qemu/thread.h | 10 +++++++++- util/qemu-thread-posix.c | 4 ++-- util/qemu-thread-win32.c | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 2c0d85f3bc..460568d67d 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -32,7 +32,7 @@ void qemu_rec_mutex_init(QemuRecMutex *mutex); void qemu_rec_mutex_destroy(QemuRecMutex *mutex); void qemu_rec_mutex_lock_impl(QemuRecMutex *mutex, const char *file, int line); int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, int line); -void qemu_rec_mutex_unlock(QemuRecMutex *mutex); +void qemu_rec_mutex_unlock_impl(QemuRecMutex *mutex, const char *file, int line); typedef void (*QemuMutexLockFunc)(QemuMutex *m, const char *f, int l); typedef int (*QemuMutexTrylockFunc)(QemuMutex *m, const char *f, int l); @@ -110,6 +110,9 @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func; #define qemu_mutex_unlock(mutex) \ qemu_mutex_unlock_impl(mutex, __FILE__, __LINE__) +#define qemu_rec_mutex_unlock(mutex) \ + qemu_rec_mutex_unlock_impl(mutex, __FILE__, __LINE__) + static inline void (qemu_mutex_lock)(QemuMutex *mutex) { qemu_mutex_lock(mutex); @@ -135,6 +138,11 @@ static inline int (qemu_rec_mutex_trylock)(QemuRecMutex *mutex) return qemu_rec_mutex_trylock(mutex); } +static inline void (qemu_rec_mutex_unlock)(QemuRecMutex *mutex) +{ + qemu_rec_mutex_unlock(mutex); +} + void qemu_cond_init(QemuCond *cond); void qemu_cond_destroy(QemuCond *cond); diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 8e2b6653f5..d990826ed8 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -139,9 +139,9 @@ int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, int line) return qemu_mutex_trylock_impl(mutex, file, line); } -void qemu_rec_mutex_unlock(QemuRecMutex *mutex) +void qemu_rec_mutex_unlock_impl(QemuRecMutex *mutex, const char *file, int line) { - qemu_mutex_unlock(mutex); + qemu_mutex_unlock_impl(mutex, file, line); } void qemu_cond_init(QemuCond *cond) diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index cb5aa2018c..52eb19f351 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -105,7 +105,7 @@ int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, int line) return !TryEnterCriticalSection(&mutex->lock); } -void qemu_rec_mutex_unlock(QemuRecMutex *mutex) +void qemu_rec_mutex_unlock_impl(QemuRecMutex *mutex, const char *file, int line) { assert(mutex->initialized); LeaveCriticalSection(&mutex->lock);