[issue26154] Add private _PyThreadState_FastGet() to get the current thread state

Gregory P. Smith report at bugs.python.org
Tue Jan 19 18:25:35 EST 2016


Gregory P. Smith added the comment:

Overall +1 to this private API.  I like the UncheckedGet name better than FastGet but don't really care what the name is so long as it keeps this property: It must be non-blocking and safe to call from a signal handler.  Returning NULL in the event the value could not be obtained in such a manner is fine (unlikely to happen from the looks of the 3.5 code).

They are private and this fixes the regression in 3.5.1.  people (ab)using these private APIs should be fine writing conditional compilation code to deal with that.

We've got a similar patch on our CPython 2.7 interpreter at work (more complicated as it must do a non-blocking lock acquire in the old 2.7 code).

----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26154>
_______________________________________


More information about the Python-bugs-list mailing list