From 9881b060c315e150b047a0cad263b316f4059ddf Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Tue, 20 Oct 2015 21:27:21 +0100
Subject: [PATCH] ITS#8277 simpler check for syncrepl on config DB

Windows mutexes are recursive so the trylock test will succeed
even though the mutex is already locked. Just compare be pointers.
---
 servers/slapd/syncrepl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c
index 8323e130a6..db9a39b12a 100644
--- a/servers/slapd/syncrepl.c
+++ b/servers/slapd/syncrepl.c
@@ -5626,7 +5626,7 @@ syncrepl_config( ConfigArgs *c )
 					 * happen when running on the cn=config DB.
 					 */
 					if ( si->si_re ) {
-						if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
+						if ( si->si_be == c->be || ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
 							isrunning = 1;
 						} else {
 							/* There is no active thread, but we must still
-- 
GitLab