[Python-Dev] PEP Draft: Simplified Global Interpreter Lock acquisition for extensions

Skip Montanaro skip@pobox.com
Tue, 4 Feb 2003 21:53:49 -0600


    Mark> Every call to PyAutoThreadState_Ensure must be matched by a call
    Mark> to PyAutoThreadState_Release on the same thread.

This suggests to me that it would be nice to have a try/finally type of
construct available for C programmers, probably some ugly CPP macros
involving gotos.  I think it would simplify the call matching you indicated
(making deadlock avoidance easier) and make DECREF cleanup a bit nicer as
well.

Just a thought...

Skip