From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16721 invoked by alias); 28 Nov 2012 07:27:29 -0000 Received: (qmail 16712 invoked by uid 22791); 28 Nov 2012 07:27:28 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Nov 2012 07:27:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id EFC9E1C7ECF; Wed, 28 Nov 2012 02:27:19 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 169qUpUEgCRJ; Wed, 28 Nov 2012 02:27:19 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 96EFE2E23B; Wed, 28 Nov 2012 02:27:19 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 4F0B5C2736; Wed, 28 Nov 2012 08:27:16 +0100 (CET) Date: Wed, 28 Nov 2012 07:27:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: make thread_list static Message-ID: <20121128072716.GC3581@adacore.com> References: <87y5hmdhl0.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y5hmdhl0.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00797.txt.bz2 On Tue, Nov 27, 2012 at 11:30:19AM -0700, Tom Tromey wrote: > I've had this patch on a branch for a while and thought I would send it > today. > > I noticed that thread_list is only used in one place outside of > thread.c. It seems generally preferable to me to keep things like this > private. So, this patch makes it static and updates the one user. > > Bootstrapped and regtested on x86-64 Fedora 16. > > Let me know what you think. I like it! I think it's a good idea to shield these globals, and the use of iterate_over_threads isn't making the code that worse. We're using these kinds of iterators all over the code, so it should have a familiar feel. > 2012-11-27 Tom Tromey > > * thread.c (thread_list): Now static. > * remote.c (struct pending_resumption_data): New. > (pending_thread_callback): New function. > (append_pending_thread_resumptions): Use iterate_over_threads. > * gdbthread.h (ALL_THREADS): Remove. > (thread_list): Don't declare. -- Joel