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

A clean way to detect if a ldap_pvt_thread_mutex is locked (best would be also to know who's the owner of the lock :)

I fear yet more few minor concurrency issues in libldap; I'd like to be
able to assert if a mutex is locked from inside library functions, and it
would be great to also know who's locking it.  What I'd do is

#define ISLOCKED(m) \
        ( ldap_pvt_mutex_trylock( (m) ) ? 1 \
                : ( ldap_pvt_mutex_unlock( (m) ), 0 ) )



Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

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