From c70e2e08692c02c34f1c293bc7ddb7307e7f28f7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 25 May 2020 22:38:30 +0100 Subject: [PATCH] ITS#9264 more for unique locking --- servers/slapd/overlays/unique.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index 69e026a7b0..17344e1cd4 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -1121,8 +1121,10 @@ unique_add( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; - if ( domain->serial && !locked ) + if ( domain->serial && !locked ) { ldap_pvt_thread_mutex_lock( &private->serial_mutex ); + locked = 1; + } /* terminating NUL */ ks += sizeof("(|)"); @@ -1259,8 +1261,10 @@ unique_modify( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; - if ( domain->serial && !locked ) + if ( domain->serial && !locked ) { ldap_pvt_thread_mutex_lock( &private->serial_mutex ); + locked = 1; + } /* terminating NUL */ ks += sizeof("(|)"); @@ -1425,8 +1429,10 @@ unique_modrdn( /* skip this domain if it isn't involved */ if ( !ks ) continue; - if ( domain->serial && !locked ) + if ( domain->serial && !locked ) { ldap_pvt_thread_mutex_lock( &private->serial_mutex ); + locked = 1; + } /* terminating NUL */ ks += sizeof("(|)");