From patchwork Sun Oct 29 17:35:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 78679 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6212838618EA for ; Sun, 29 Oct 2023 17:38:51 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id BB730386181F for ; Sun, 29 Oct 2023 17:38:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB730386181F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB730386181F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698601111; cv=none; b=lAGuGAqoeViXXsLktdw6Bu/cp9RjS31jP3Snx1KtGxasLvkpUWqqsRiexnoy6D9hermJ4Im1PiYxVoe6AkDxNUXsmKd0BAig91aY+vNnRx0pxzSnX/AFiw0Mff3SihI+uCOyfldfSKEXqeos0QB3v2/PD53w7UYva4AHQr3T2es= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698601111; c=relaxed/simple; bh=t16ZraLoCqjN4M7vU+0ngbbcf7flaHwl5qyXYBIA4hM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wrbTXjA58cd7lCzdnKI+gOx34C69MXf+9UworPn6IylBS9sBWFsyhsq1MrBNnp/IOmI6wOxwuVsNqo/0Fed2HzZK2OfNJ1DnC8e67auGURc+/ItA0YpZAnVDENRHZnr5RKLVwYvf9NgknKw5QuYGYelKWLMNvYm1shHh9Fyn7dw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6001a.ext.cloudfilter.net ([10.0.30.140]) by cmsmtp with ESMTPS id wyqCqcka6jtZ3x9k3qSzR1; Sun, 29 Oct 2023 17:38:27 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id x9k1qFRZ1NUwRx9k1q6Rj2; Sun, 29 Oct 2023 17:38:25 +0000 X-Authority-Analysis: v=2.4 cv=I852+fsg c=1 sm=1 tr=0 ts=653e9891 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=IPg9qJz9c1GkRlobM_gA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=OsZNRmuSf89b12KsYeBh7j3r+Yei2IcD6eLGmEK9ej4=; b=Xc+2UWDpiBR+Pq8/KGSr5dGXkP pyS5ReBRy2nbNR8P6is4fWX3IonSpyrJejxP3TafQ84Yx+4GwQnisgk3z2vw/fUibgJAHKzhnqxDk uwfWydOcu9GHcC/EQAMBGdotU; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:47464 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1qx9k1-000nk4-17; Sun, 29 Oct 2023 11:38:25 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 07/15] Change how cooked index waits for threads Date: Sun, 29 Oct 2023 11:35:26 -0600 Message-ID: <20231029173839.471514-8-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231029173839.471514-1-tom@tromey.com> References: <20231029173839.471514-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.77.73 X-Source-L: No X-Exim-ID: 1qx9k1-000nk4-17 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (localhost.localdomain) [97.122.77.73]:47464 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJM5OjYHndAANPAC/a654Zm4f03R84RQqTetEzL6mXHXzkY72hWzyScOvEDh193utqe/vPnKMEWRAT67zGeFYqkzy2qkoUSaQFH2SSExcYYP57w4D5AT XSm3DxXmGBs+Q4QnyOxB9j+r2gDC/TkhC5gLY9i/R4JmiU8WzzRcJWRf41WQIW2ft00rLcb7DYu3+TBhJQVnE/FRBY/U4lVYxDc= X-Spam-Status: No, score=-3024.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This changes the cooked index code to wait for threads in its public-facing API. That is, the waits are done in cooked_index now, and never in the cooked_index_shard. Centralizing this decision makes it easier to wait for other events here as well. --- gdb/dwarf2/cooked-index.c | 3 +-- gdb/dwarf2/cooked-index.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 58ea541a5c9..a474691cfb4 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -405,8 +405,6 @@ cooked_index_shard::do_finalize () cooked_index_shard::range cooked_index_shard::find (const std::string &name, bool completing) const { - wait (); - cooked_index_entry::comparison_mode mode = (completing ? cooked_index_entry::COMPLETE : cooked_index_entry::MATCH); @@ -529,6 +527,7 @@ cooked_index::get_addrmaps () const cooked_index::range cooked_index::find (const std::string &name, bool completing) const { + wait (); std::vector result_range; result_range.reserve (m_vector.size ()); for (auto &entry : m_vector) diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 0db6e8003b9..14352c1e139 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -287,7 +287,6 @@ class cooked_index_shard /* Return a range of all the entries. */ range all_entries () const { - wait (); return { m_entries.cbegin (), m_entries.cend () }; } @@ -460,6 +459,7 @@ class cooked_index : public dwarf_scanner_base /* Return a range of all the entries. */ range all_entries () const { + wait (); std::vector result_range; result_range.reserve (m_vector.size ()); for (auto &entry : m_vector)