The real problem is that SWIG is not well documented (I saw tips to use the change log to search;)).
Well, I found out that I can perform built-in functions in SWIG and use macros to issue / receive GIL, it looks like this:
%inline %{ void wrappedFunction(OriginalObject *o, <parameters>) { Py_BEGIN_ALLOW_THREADS o->originalFunction(<parameters>); Py_END_ALLOW_THREADS } %}
This function is missing in the original C ++, but is available in the python module. This is (almost) exactly what I wanted. (I would like to wrap the original method, for example, a python decorator)
uhz
source share