aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-04-23 17:44:31 +0200
committerEric Laurent <elaurent@google.com>2015-04-24 13:39:15 -0700
commit009c8fa7be02f9a986e5cf078ce40e1188738c89 (patch)
treef7cc56bca49df2d5354d6e71bb4bba00b026265c
parent12d9c82b31650d307e3834e435e1f5f54e3832d0 (diff)
downloadexternal_parameter-framework-009c8fa7be02f9a986e5cf078ce40e1188738c89.zip
external_parameter-framework-009c8fa7be02f9a986e5cf078ce40e1188738c89.tar.gz
external_parameter-framework-009c8fa7be02f9a986e5cf078ce40e1188738c89.tar.bz2
python bindings: activate thread-safety code generation
The Parameter Framework may spawn a thread listening to request for command execution. In this case, whenever a command produces a log, a callback function provided by the client is called. When the client is a python script using the python bindings, this causes a python function to be called in a different context than the main thread. This can only work safely if a specific lock is held before hand; see https://docs.python.org/2/c-api/init.html#non-python-created-threads Fortunately, SWIG can generate the corresponding code automatically using %module(threads=1, ...) mymodule Signed-off-by: David Wagner <david.wagner@intel.com>
-rw-r--r--bindings/python/pfw.i2
1 files changed, 1 insertions, 1 deletions
diff --git a/bindings/python/pfw.i b/bindings/python/pfw.i
index 9dbccbd..2d39228 100644
--- a/bindings/python/pfw.i
+++ b/bindings/python/pfw.i
@@ -32,7 +32,7 @@
// like derived C++ classes (calls to virtual methods will be properly
// forwarded to Python) - only on classes for which is it specified, see
// ILogger below..
-%module(directors="1") PyPfw
+%module(directors="1", threads="1") PyPfw
%feature("director:except") {
if ($error != NULL) {