https://bugs.openldap.org/show_bug.cgi?id=8871
--- Comment #4 from Ondřej Kuzník ondra@mistotebe.net --- On Thu, Mar 04, 2021 at 06:24:28PM +0000, openldap-its@openldap.org wrote:
--- Comment #2 from hsuenju_ko@stratus.com hsuenju_ko@stratus.com --- This used to work before #6672. The code used to unlock the ld_conn_mutex before the select call.
what if one thread is doing ldap_result with indefinite wait while other thread is doing something, not necessary cancel, which also requires holding the ld_conn_mutex lock? Are you saying no other thread is allowed to do anything requiring the same ld_conn_mutex?
You can't use the connection while another thread is waiting there (and holding the mutex), this is not how libldap works. What you can do is retrieve the fd with LDAP_OPT_DESC, wait until there's activity and then call ldap_result with a timeout set to 0 to see if you got what you were interested in. Then you're able to send more requests while waiting, from any thread you want as long as they're not stuck waiting on network.
If I can not use the same connection, how do I do multiple connections? Can I cancel operations from different connection?
Cancel and unbind operations can only stop the processing of a request sent over the same connection.