This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [[inferior events] partial cleanup for copy_py_list
- From: Tom Tromey <tromey at redhat dot com>
- To: sami wagiaalla <swagiaal at redhat dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Wed, 15 Dec 2010 09:42:12 -0700
- Subject: Re: [[inferior events] partial cleanup for copy_py_list
- References: <m3ei9kowv9.fsf@fleche.redhat.com> <4D08E57D.4000200@redhat.com>
Tom> I think it should probably use an iterator to go through the list.
Tom> Otherwise it is susceptible to a bug where another thread changes the
Tom> list while we are iterating over it.
Sami> Hmm I did not know we had the option of using a safe iterator. If we
Sami> do then that eliminates the need for copy_py_list in the first place;
Sami> copy_py_list is used to make the call back of listeners safe against
Sami> one listener editing the list during the iteration by removing an
Sami> element.
TBH, I am not totally sure how things work in this area.
One option would be to use the existing convenience function
PyList_AsTuple, and just trust the Python core to get it right.
Tom