From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 619D83858004 for ; Sun, 10 Dec 2023 21:41:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 619D83858004 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 619D83858004 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702244488; cv=none; b=UvhNbFqMg4TS7iqA4Se7sKnGFRwui8zytwttw1Bi7VgtY3XDcdjzAshHpw/PCIapLQCexWSorLwuOejixzM5MdwuY3vivfbYgkfwHljMnLnKvviWOo8uFZvIMtJdD0Q5M3VqDApfQGIyKeK/5ou1Tzn1f3CsKNQD9L/W2LbUysQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702244488; c=relaxed/simple; bh=V/mQnD8z981JTbapwbeV0Z59LME1lsiTv2c+RV8y0Yo=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=KahB0oh2fvknC5LCDKXVbv/EhzeK1rZU3chZfmO+UosnscJL2rrptmk5BO5ix/z7R0PcA7QFnlWKt2Ey7MnmNmr/YlnQZMhCECbER9tm2fXEEwWdGYnaxLcnEvukFNtTMpROHSvOYabpDcuB0xQakEFUi7Fj7+lZIZTbxvcOJ7k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5008a.ext.cloudfilter.net ([10.0.29.246]) by cmsmtp with ESMTPS id CKqirBWYOL9AgCRYArYJRm; Sun, 10 Dec 2023 21:41:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id CRY9rSUxvkUbtCRY9r37NC; Sun, 10 Dec 2023 21:41:22 +0000 X-Authority-Analysis: v=2.4 cv=WpU4jPTv c=1 sm=1 tr=0 ts=65763082 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=IPg9qJz9c1GkRlobM_gA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=dLaAjqFh0cKLdjMVw6rM1z+Uqxd2QZIus3vQXk+ZN5E=; b=rkvT5j+LBQtD1Ls0QOyJdZNeCj r8M2PEubie0bw1m9xgYbL9TbkvisXmM3UHnp3PdXMjEVvyjTpAaznI5JnwHYTdph+M1uPrIytLtFL up2YHL8BeEp2CstP1ZRF3AD0Z; Received: from [198.59.47.65] (port=52450 helo=[192.168.131.83]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rCRY9-000SHj-0k for gdb-patches@sourceware.org; Sun, 10 Dec 2023 14:41:21 -0700 From: Tom Tromey Date: Sun, 10 Dec 2023 14:41:19 -0700 Subject: [PATCH v4 11/19] Change how cooked index waits for threads MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231210-t-bg-dwarf-reading-v4-11-b978c32fd12f@tromey.com> References: <20231210-t-bg-dwarf-reading-v4-0-b978c32fd12f@tromey.com> In-Reply-To: <20231210-t-bg-dwarf-reading-v4-0-b978c32fd12f@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 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: 198.59.47.65 X-Source-L: No X-Exim-ID: 1rCRY9-000SHj-0k X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.131.83]) [198.59.47.65]:52450 X-Source-Auth: tom+tromey.com X-Email-Count: 14 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfDfaecJCxdOZldfUbaPpP610DMxQNkNfQxhT9O55g0FnwjlO/Wv4wk3ttJQ7iWpE75OpKoaMZQXrp/FvGeUOjJnfk4dqLizJ4IOnZE3RkoWF0oOiNNSS X7oByDtXsGt1L6pdmVJGRjh/oQIrypQIisPOYiC9lxLK468jrUTrNgeHdxLOTMaUNJLlkmMmMauIJfdZhnEQ12/SoCEra4kLzfI= X-Spam-Status: No, score=-3024.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 ba77f9cb373..7588b5c2896 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -409,8 +409,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); @@ -528,6 +526,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 36b734f0fb6..97f09668c7b 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) -- 2.43.0