if( rw->ltrw_valid != LDAP_PVT_THREAD_RDWR_VALID )
return LDAP_PVT_THREAD_EINVAL;
ldap_pvt_thread_mutex_lock( &rw->ltrw_mutex );
/* active threads? */
if( rw->ltrw_valid != LDAP_PVT_THREAD_RDWR_VALID )
return LDAP_PVT_THREAD_EINVAL;
ldap_pvt_thread_mutex_lock( &rw->ltrw_mutex );
/* active threads? */