ldap/servers/plugins/memberof/memberof.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 238b74de64b79adf4b55ebc1d48803c27f183355
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Jul 26 11:06:04 2011 -0700
Bug 725743 - Make memberOf use PRMonitor for it's operation lock
We currently use a mutex for the operation lock in the memberOf
plug-in. This can cause a deadlock issue since the locks are not
re-entrant. When memberOf performs an internal operation that
triggers another plug-in to perform an internal operation, a
deadlock will occur if this second internal operation triggers
memberOf again.
This patch switches memberOf to use PRMonitor instead, which is
re-entrant.
diff --git a/ldap/servers/plugins/memberof/memberof.c
b/ldap/servers/plugins/memberof/memberof.c
index 72ad1a0..92d45e2 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -77,7 +77,7 @@ static Slapi_PluginDesc pdesc = { "memberof", VENDOR,
DS_PACKAGE_VERSION, "memberof plugin" };
static void* _PluginID = NULL;
-static Slapi_Mutex *memberof_operation_lock = 0;
+static PRMonitor *memberof_operation_lock = 0;
MemberOfConfig *qsortConfig = 0;
static int g_plugin_started = 0;
@@ -278,7 +278,7 @@ int memberof_postop_start(Slapi_PBlock *pb)
goto bail;
}
- memberof_operation_lock = slapi_new_mutex();
+ memberof_operation_lock = PR_NewMonitor();
if(0 == memberof_operation_lock)
{
rc = -1;
@@ -2147,12 +2147,12 @@ int memberof_qsort_compare(const void *a, const void *b)
void memberof_lock()
{
- slapi_lock_mutex(memberof_operation_lock);
+ PR_EnterMonitor(memberof_operation_lock);
}
void memberof_unlock()
{
- slapi_unlock_mutex(memberof_operation_lock);
+ PR_ExitMonitor(memberof_operation_lock);
}
typedef struct _task_data
Show replies by date