Why LDAPObject.._ldap_object_lock around library calls?

Ken Key key-ldap-dev at KSquared.NET
Wed May 5 21:26:12 CEST 2004

Ah, I found the answer to my question.  Since we store the thread
state in the LDAPObject instance, the object cannot be shared between
my two threads.

I tossed together a prototype of the two-thread model I was thinking of.
With the LDAPObject._ldap_lock in place, I got the deadlock I was
afraid of.  When I removed the _ldap_lock.acquire/release in
_ldap_call() I got the "saving thread twice?" fatal error from the
LDAP_BEGIN_ALLOW_THREADS() when the second thread makes the second
function call.

This message may arrive out-of-order with my original reply, sorry
about that.  I forgot to reset my From: line.


More information about the python-ldap mailing list