@@ -125,12 +125,8 @@ static apr_table_t *collection_retrieve_ex(apr_sdbm_t *existing_dbm, modsec_rec
125125
126126 if (existing_dbm == NULL ) {
127127#ifdef GLOBAL_COLLECTION_LOCK
128- rc = apr_global_mutex_lock (msr -> modsecurity -> dbm_lock );
129- if (rc != APR_SUCCESS ) {
130- msr_log (msr , 1 , "collection_retrieve_ex: Failed to lock proc mutex: %s" ,
131- get_apr_error (msr -> mp , rc ));
132- goto cleanup ;
133- }
128+ rc = msr_global_mutex_lock (msr , msr -> modsecurity -> dbm_lock , "collection_retrieve_ex" );
129+ if (rc != APR_SUCCESS ) goto cleanup ;
134130#endif
135131 rc = apr_sdbm_open (& dbm , dbm_filename , APR_READ | APR_SHARELOCK ,
136132 CREATEMODE , msr -> mp );
@@ -222,12 +218,8 @@ static apr_table_t *collection_retrieve_ex(apr_sdbm_t *existing_dbm, modsec_rec
222218 if (apr_table_get (col , "KEY" ) == NULL ) {
223219 if (existing_dbm == NULL ) {
224220#ifdef GLOBAL_COLLECTION_LOCK
225- rc = apr_global_mutex_lock (msr -> modsecurity -> dbm_lock );
226- if (rc != APR_SUCCESS ) {
227- msr_log (msr , 1 , "collection_retrieve_ex: Failed to lock proc mutex: %s" ,
228- get_apr_error (msr -> mp , rc ));
229- goto cleanup ;
230- }
221+ rc = msr_global_mutex_lock (msr , msr -> modsecurity -> dbm_lock , "collection_retrieve_ex" );
222+ if (rc != APR_SUCCESS ) goto cleanup ;
231223#endif
232224 rc = apr_sdbm_open (& dbm , dbm_filename , APR_CREATE | APR_WRITE | APR_SHARELOCK ,
233225 CREATEMODE , msr -> mp );
@@ -408,12 +400,8 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
408400
409401#ifdef GLOBAL_COLLECTION_LOCK
410402 /* Need to lock to pull in the stored data again and apply deltas. */
411- rc = apr_global_mutex_lock (msr -> modsecurity -> dbm_lock );
412- if (rc != APR_SUCCESS ) {
413- msr_log (msr , 1 , "collection_store: Failed to lock proc mutex: %s" ,
414- get_apr_error (msr -> mp , rc ));
415- goto error ;
416- }
403+ int ret = msr_global_mutex_lock (msr , msr -> modsecurity -> dbm_lock , "collection_store" );
404+ if (ret != APR_SUCCESS ) goto error ;
417405#endif
418406
419407 /* Delete IS_NEW on store. */
@@ -684,12 +672,8 @@ int collections_remove_stale(modsec_rec *msr, const char *col_name) {
684672 }
685673
686674#ifdef GLOBAL_COLLECTION_LOCK
687- rc = apr_global_mutex_lock (msr -> modsecurity -> dbm_lock );
688- if (rc != APR_SUCCESS ) {
689- msr_log (msr , 1 , "collections_remove_stale: Failed to lock proc mutex: %s" ,
690- get_apr_error (msr -> mp , rc ));
691- goto error ;
692- }
675+ rc = msr_global_mutex_lock (msr , msr -> modsecurity -> dbm_lock , "collections_remove_stale" );
676+ if (rc != APR_SUCCESS ) goto error ;
693677#endif
694678
695679 rc = apr_sdbm_open (& dbm , dbm_filename , APR_CREATE | APR_WRITE | APR_SHARELOCK ,
0 commit comments