Glen Walker <g...@walker.gen.nz> added the comment: Correct me if I'm wrong, the change released in Python 2.7.15 doesn't actually fix this race condition.
The race is: * T1: gc_was_enabled = gc.isenabled() # True * T1: gc.disable() * T2: gc_was_enabled = gc.isenabled() # False * T1: gc.enable() * T2: gc.disable() To fix the race condition _disabling_gc_lock must also be held for gc.enable() in both call locations so it cannot happen between gc.isenabled() and gc.disable(). TBH, I'm not really expecting this to be fixed, this is more a note for any future travelers who come across this issue. ---------- nosy: +gwalker _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue27448> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com