simplify the thread implementation, use feature 'nothread' to disable threads instead of 'thread' to enable them, plus other fixes around threads
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7933 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d35515351b
commit
2eeef5275d
6 changed files with 62 additions and 101 deletions
|
|
@ -21,49 +21,32 @@ Version 1.3.28 (unreleased).
|
|||
1.- the module thread support is enable via the "threads" module
|
||||
option, ie
|
||||
|
||||
%module("threads"=1)
|
||||
|
||||
2.- For each method you want to add full thread support, you
|
||||
should use the "threads" feature, as in
|
||||
|
||||
%feature("threads") method;
|
||||
|
||||
or in the directive form
|
||||
|
||||
%threads method;
|
||||
|
||||
3.- Since threads is a feature, you can enable it for the
|
||||
entire interface as follow
|
||||
|
||||
%module("threads"=1)
|
||||
%threads;
|
||||
|
||||
4.- Equivalent to that, is the following swig option
|
||||
2.- Equivalent to that, is the following swig option
|
||||
|
||||
swig -threads -python ...
|
||||
|
||||
ie, swig enables thread support for the module and all
|
||||
the methods.
|
||||
ie, swig enables thread support for the module.
|
||||
|
||||
5.- You can partially disable thread support for each
|
||||
3.- You can partially disable thread support for a given
|
||||
method using:
|
||||
|
||||
%feature("nothreads") method;
|
||||
%feature("nothread") method;
|
||||
|
||||
also, you can disable sections of the thread support,
|
||||
for example
|
||||
|
||||
%feature("nothreadsblock") method;
|
||||
%feature("nothreadsallow") method;
|
||||
%feature("nothreadblock") method;
|
||||
%feature("nothreadallow") method;
|
||||
|
||||
the first disable the C++/python thread protection, and the
|
||||
second the python/C++ thread protection. See
|
||||
pythreads.swg for more information.
|
||||
the first disables the C++/python thread protection, and the
|
||||
second disables the python/C++ thread protection.
|
||||
|
||||
6.- The current thread support is based in the PyGIL
|
||||
4.- The current thread support is based in the PyGIL
|
||||
extension present in python version 2.3 or later, but
|
||||
you can provide the thread code for older versions by
|
||||
defining the macros described in pythreads.swg.
|
||||
defining the macros in pythreads.swg.
|
||||
|
||||
If you get a working implementation for older versions,
|
||||
please send us a patch.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue