From 26266ac4765b0c90625c95a26aa578b0f8b8c0c6 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Wed, 25 Feb 2015 05:44:07 +0000
Subject: [PATCH] ITS#8063 don't block our own thread

---
 servers/slapd/overlays/syncprov.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c
index 5cd259fb55..2d10fe70a7 100644
--- a/servers/slapd/overlays/syncprov.c
+++ b/servers/slapd/overlays/syncprov.c
@@ -2122,6 +2122,10 @@ syncprov_op_mod( Operation *op, SlapReply *rs )
 			mt->mt_tail = mi;
 			/* wait for this op to get to head of list */
 			while ( mt->mt_mods != mi ) {
+				/* don't wait on other mods from the same thread */
+				if ( mt->mt_mods->mi_op->o_threadctx == op->o_threadctx )
+					break;
+
 				ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
 				/* FIXME: if dynamic config can delete overlays or
 				 * databases we'll have to check for cleanup here.
-- 
GitLab