[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#4441) Usage of mutex in OpenLDAP (design question)



[please direct OpenLDAP related discussion to the most appropriate list]

> I was happy to see that the ld_conn_mutex destroy patch (ITS #4441)
> gets committed.  However, I think the implementation there looks
> quite weird, as the mutexes were initialized by ldap_create() (called
> by ldap_init) were destroyed in ldap_unbind, which makes it into
> a very sad state where we can not ldap_bind() again without ldap_init().
>
> I think the mutex initialization should be either pushed down into
> ldap_bind() (which does initialization, etc., using a global mutex),
> or the mutex uninitialization should be separated into another
> thread-safe-specific function, e.g. ldap_fini() or so.  What do
> you think about this issue?

This discussion seems to belong to OpenLDAP-software, as it discusses API
usage (and, occasionally, API redesign).

You seem to be misguided by the function names (which is unhappy) into
believing that ldap_unbind() is the reverse of ldap_bind(); actually, it
is the reverse of ldap_init[ialize]().  If you need to re-bind on an
existing connection you don't need to ldap_unbind(); a bind operation
implicitly brings the connection back to anonymous state before starting,
and requires no further operations to be pending on that connection.

p.



Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it
------------------------------------------