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

Re: (more) concurrency issues in libldap_r?

Pierangelo Masarati writes:
> (...) To try and work it out, I've replaced most of the calls to
>         ldap_pvt_thread_mutex_lock( &some_mutex );
> with
>         while ( ldap_pvt_thread_mutex_trylock( &some_mutex ) )
>                 ldap_pvt_thread_yield();
> This seems to cure the problem (up to now)

If ldap_pvt_thread_mutex_lock doesn't yield when it has to wait, that
sounds like a bug in the threads implementation to me.  So I suggest to
- test it on some other operating system,
- bugreport it when it hopefully turns out to be OS-dependent, and
- insert that code in ldap_pvt_thread_mutex_lock itself, if possible
  #ifdeffed on a configure test which detects the problem.

Under capitalism man exploits man, under communism it's just the opposite.