Accessing a lock object in a C module

Konrad Hinsen hinsen at cnrs-orleans.fr
Tue Feb 1 09:54:54 EST 2000


For a threaded application, I need to access a lock both from Python
code and from a C extension module, but I haven't yet found a way to
do that.

If I create a lock object in Python via the thread module, I can't
access its lock_lock member; the structure definition is not in a
header file, and there is no C-level access routine either. Inversely,
if I create a lock in a C module, I can't create a corresponding lock
object accessible from Python.

It seems that the only solution is to use PyObject_CallMethod on the
lock object in my C module, which means additional interpreter overhead.
Has anyone found another method?
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list