This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: [[inferior events] partial cleanup for copy_py_list


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


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