Revision caa1539...

Go back to digest for 24th June 2012

Features in KDE Base

Shaheed Haque committed changes in [kate] /pate/src:

Enable threaded Python support.

The Pate code had commented out code for threaded Python support, but
this could not be turned on, or PyFinalize() called without causing

These seem fundamentally to have been caused by the lack of a
consistent way to get and release the GIL. In order to overcome this,
the Py namespace was converted into a Python class, whose constructor
and destructor take care of the GIL. At the same time, making all the
utility functions members of this class means that the compiler tells
us where the class in needed in many cases.

In the remaining cases (i.e. bare calls to the Python C API),
inspection is used to add the requisite Python() object. To prevent
this object being optimised away in these cases due to lack of use,
all instances have the form of an assignment.

The code now has thread support enabled, and calls PyFinalize(). The
thread support has yet to be exercised.

File Changes

Modified 5 files
  • /pate/src
  •   playground/engine.cpp
  •   playground/engine.h
  •   playground/plugin.cpp
  •   playground/utilities.cpp
  •   playground/utilities.h
5 files changed in total