I'm a little new at integrating C code that needs callback functions to
Python and I'm not quite sure what the correct way to acquire the GIL
is.<br>
<br>
in my callback function I've got:<br>
<br>
cdef void someCallback(char *blah):<br>
&nbsp;&nbsp; PyGILState_Ensure()<br>
&nbsp;&nbsp; # do stuff<br>
&nbsp;&nbsp; PyGILState_Release()<br>
<br>
How do I properly write the pxd file to expose the pystate.h functions to grab the GIL?<br>
<br>
I'm confused by stuff like:<br>
<br>
PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);<br>
<br>
Do I have to translate PyAPI_FUNC and PyGILState_STATE into Pyrex ctypedef declarations?<br>
<br>
vic<br>
<br>-- <br>&quot;Never attribute to malice that which can be adequately explained by stupidity.&quot;&nbsp;&nbsp;- Hanlon's Razor<br>