GIL Ensure/Release functionality Added to VTK and Paraview

Some people have been experiencing some problems with the Python interpreter in VTK and ParaView, when initializing their own Python interpreter and using ParaView Python capability as well.

A new CMake variable has been added to ParaView, VTK_PYTHON_FULL_THREADSAFE, which will turn on the GIL Ensure/Release on all VTK and ParaView Python calls.

If you are developing for VTK and ParaView, make sure to use the vtkPythonScopeGilEnsurer before any Python call. It is a noop without the CMmake option, but will automatically call PyGILState_Ensure() and PyGILState_Release() on the scope of the variable if defined.

In vtkPythonInterpreter.cxx e.g. :



Questions or comments are always welcome!