This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: make thread_list static


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  <tromey@redhat.com>
> 
> 	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]