[Python-Dev] Change definition of Py_END_ALLOW_THREADS?

Guido van Rossum guido@python.org
Thu, 13 Feb 2003 17:57:25 -0500


> Well, I was thinking of:
> 
> #ifdef __cplusplus
> class PyAutoThreadState {
>   PyAutoThreadState() {state = PyAutoThreadState_Ensure();}
>   ~PyAutoThreadState() {PyAutoThreadState_Restore(state);}
>   PyAutoThreadState_State state;
> }
> #endif
> 
> Meaning the C level API is always there, but a C++ compiler on any platform
> should allow extension authors to say:
> 
> void MyCppFunc(void)
> {
>    PyAutoThreadState state;
> }
> 
> And the rest happens by magic.
> 
> Was-only-half-serious-but-getting-more-so ly,

OK, that works for me.

--Guido van Rossum (home page: http://www.python.org/~guido/)