Re: [Pyrex] Callbacks from threads and PyGILState_Ensure/PyGILState_Release
Robert Bradshaw wrote:
> On Sep 10, 2007, at 2:08 PM, Stefan Behnel wrote:
>
>> Stefan Behnel wrote:
>>> Ulisses Furquim wrote:
>>>> Here is the patch with '__grabGIL' renamed to 'withGIL'. I also
>>>> thought that 'withGIL' was a better name to say we're gonna execute
>>>> that function _with the GIL_. IOW, it more clear we're gonna grab the
>>>> GIL and release it afterwards.
>>>
>>> Thanks, it applies cleanly for me. I will give it some testing.
>>
>> Hmm, the first problem I encountered was that it changes the signature
>> that
>> Cython sees. So I get this error when assigning a "withGIL" function to a
>> typed function slot:
>>
>> ========================================================
>> Cannot assign type 'void ((void (*),char (*),char (*),char (*))
>> withGIL)' to
>> 'endElementNsSAX2Func'
>> ========================================================
>
> On the other hand, by requiring the two signature to match exactly, it
> is clear exactly what is happening. If you don't require them to match,
> does it do withGIL if only the pxd file/only the pyx file has that flag?
Didn't test, but I don't think so (and I hope it doesn't). It's specific to
the implementation of the function itself, so if it's not declared on the
(Continue reading)