+ ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
+ ldap_pvt_thread_mutex_lock( &ld->ld_conn_mutex );
+#endif
+ for ( lc = ld->ld_conns; rc == -2 && lc != NULL;
+ lc = nextlc )
+ {
+ nextlc = lc->lconn_next;
+ if ( lc->lconn_status == LDAP_CONNST_CONNECTED &&
+ ldap_is_read_ready( ld, lc->lconn_sb ))
+ {
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );
+#endif
+ rc = try_read1msg( ld, msgid, all,
+ lc->lconn_sb, &lc, result );
+ if ( lc == NULL ) lc = nextlc;
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_lock( &ld->ld_conn_mutex );
+#endif
+ }
+ }
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );