From: Michael <mi...@st...> - 2001-05-14 10:42:03
|
Michael Str=F6der wrote: > = > I wrote a drop-in replacement class for LDAPObject for locking calls > into the LDAP libs since these are not completely thread-safe I've added this module as python-ldap/Lib/ldapthreadlock.py to the CVS repository. See __doc__ string: """ ldapthreadlock.py - mimics LDAPObject class in a thread-safe way (c) by Michael Stroeder <mi...@st...> License: Do anything you want with this module. Compability: - The behaviour of the ldapthreadlock.LDAPObject class should be exactly the same like ldap.LDAPObject - This module needs your Python installation to be built with thread support (module threading is imported). Usage: You can simply use function open() of this module instead of function open() of module ldap to create an instance of LDAPObject class. Basically calls into the LDAP lib are serialized by the module-wide lock _ldapmodule_lock. To avoid blocking of other threads synchronous methods like search_s() etc. and the result() method were rewritten to do solely asynchronous LDAP lib calls with zero timeout. The timeout handling is done within the method result() which probably leads to less exact timing. """ Ciao, Michael. |