Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/dna In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32691/ldap/servers/plugins/dna
Modified Files: dna.c Log Message: Resolves: 456968 Summary: Use a separate new value lock for each DNA managed range.
Index: dna.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/dna/dna.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- dna.c 30 Jul 2008 17:43:40 -0000 1.5 +++ dna.c 30 Jul 2008 18:17:26 -0000 1.6 @@ -114,6 +114,7 @@ Slapi_Filter *slapi_filter; char *generate; char *scope; + Slapi_Mutex *new_value_lock; };
static PRCList *dna_global_config = NULL; @@ -123,11 +124,6 @@ static char *_PluginDN = NULL;
-/* - * new value lock - */ -static Slapi_Mutex *g_new_value_lock; - /** * * DNA plug-in management functions @@ -332,9 +328,8 @@ "--> dna_start\n");
g_dna_cache_lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, "dna"); - g_new_value_lock = slapi_new_mutex();
- if (!g_dna_cache_lock || !g_new_value_lock) { + if (!g_dna_cache_lock) { slapi_log_error(SLAPI_LOG_FATAL, DNA_PLUGIN_SUBSYSTEM, "dna_start: lock creation failed\n");
@@ -570,9 +565,15 @@ "----------> dnaMaxValue [%ld]\n", value, 0, 0);
slapi_ch_free_string(&value); - } else + } else { entry->maxval = -1; + }
+ /* create the new value lock for this range */ + entry->new_value_lock = slapi_new_mutex(); + if (!entry->new_value_lock) { + goto bail; + }
/** * Finally add the entry to the list @@ -666,6 +667,9 @@ if (e->scope) slapi_ch_free_string(&e->scope);
+ if (e->new_value_lock) + slapi_destroy_mutex(e->new_value_lock); + slapi_ch_free((void **) entry); }
@@ -954,7 +958,7 @@ * with itself so we lock here */
- slapi_lock_mutex(g_new_value_lock); + slapi_lock_mutex(config_entry->new_value_lock);
for (attempts = 0; attempts < 3; attempts++) {
@@ -1104,7 +1108,7 @@
done:
- slapi_unlock_mutex(g_new_value_lock); + slapi_unlock_mutex(config_entry->new_value_lock);
if (LDAP_SUCCESS != ret) slapi_ch_free_string(&old_value);
389-commits@lists.fedoraproject.org