Rename the mutex used to protect the block reason statistics
authorFabian Keil <fk@fabiankeil.de>
Tue, 16 Mar 2021 18:09:24 +0000 (19:09 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 17 Apr 2022 08:08:21 +0000 (10:08 +0200)
... to be more precise so I can use the previous name
in a following commit.

filters.c
jcc.c
jcc.h

index 07830c3..48259a8 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -3085,14 +3085,14 @@ void register_block_reason_for_statistics(const char *block_reason)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    if (block_statistics == NULL)
    {
       block_statistics = zalloc_or_die(sizeof(struct block_statistics_entry));
       entry = block_statistics;
       entry->block_reason = strdup_or_die(block_reason);
-      privoxy_mutex_unlock(&block_statistics_mutex);
+      privoxy_mutex_unlock(&block_reason_statistics_mutex);
       return;
    }
    entry = block_statistics;
@@ -3112,7 +3112,7 @@ void register_block_reason_for_statistics(const char *block_reason)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }
 
@@ -3133,7 +3133,7 @@ static void increment_block_reason_counter(const char *block_reason)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    entry = block_statistics;
    while (entry != NULL)
@@ -3146,7 +3146,7 @@ static void increment_block_reason_counter(const char *block_reason)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }
 
@@ -3169,7 +3169,7 @@ void get_block_reason_count(const char *block_reason, unsigned long long *count)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    entry = block_statistics;
    while (entry != NULL)
@@ -3182,7 +3182,7 @@ void get_block_reason_count(const char *block_reason, unsigned long long *count)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }
 
diff --git a/jcc.c b/jcc.c
index 17aa039..ef79d60 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -193,7 +193,7 @@ privoxy_mutex_t client_tags_mutex;
 #endif
 #ifdef FEATURE_EXTENDED_STATISTICS
 privoxy_mutex_t filter_statistics_mutex;
-privoxy_mutex_t block_statistics_mutex;
+privoxy_mutex_t block_reason_statistics_mutex;
 #endif
 
 #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R)
@@ -5283,7 +5283,7 @@ static void initialize_mutexes(void)
 #endif
 #ifdef FEATURE_EXTENDED_STATISTICS
    privoxy_mutex_init(&filter_statistics_mutex);
-   privoxy_mutex_init(&block_statistics_mutex);
+   privoxy_mutex_init(&block_reason_statistics_mutex);
 #endif
 
    /*
diff --git a/jcc.h b/jcc.h
index 3e17042..df513b8 100644 (file)
--- a/jcc.h
+++ b/jcc.h
@@ -88,7 +88,7 @@ extern privoxy_mutex_t client_tags_mutex;
 
 #ifdef FEATURE_EXTENDED_STATISTICS
 extern privoxy_mutex_t filter_statistics_mutex;
-extern privoxy_mutex_t block_statistics_mutex;
+extern privoxy_mutex_t block_reason_statistics_mutex;
 #endif
 
 #ifndef HAVE_GMTIME_R