summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-12-10 10:11:34 -0700
committerKarl Williamson <khw@cpan.org>2020-12-12 08:58:30 -0700
commit0b83dfe6dd9b0bda197566adec923f16b9a693cd (patch)
treea88559b6fd02ba22f021425905874c03c952e8f5
parent2cca577c06f55cb5263727c6fd6b02fe37c36c96 (diff)
downloadperl-0b83dfe6dd9b0bda197566adec923f16b9a693cd.tar.gz
many-reader mutexes: Change structure element name
The old name did not encompass all the possible reasons for the mutex signal condition to be invoked
-rw-r--r--perl.h2
-rw-r--r--thread.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/perl.h b/perl.h
index a839ef967a..d5cbf48dd5 100644
--- a/perl.h
+++ b/perl.h
@@ -3344,7 +3344,7 @@ typedef pthread_key_t perl_key;
/* Many readers; single writer */
typedef struct {
perl_mutex lock;
- perl_cond zero_readers;
+ perl_cond wakeup;
Size_t readers_count;
} perl_RnW1_mutex_t;
diff --git a/thread.h b/thread.h
index b34af65707..14fc1c5ac2 100644
--- a/thread.h
+++ b/thread.h
@@ -298,7 +298,7 @@
MUTEX_LOCK(mutex.lock); \
(mutex)->readers_count--; \
if ((mutex)->readers_count <= 0) { \
- COND_SIGNAL(mutex.zero_readers); \
+ COND_SIGNAL(mutex.wakeup); \
(mutex)->readers_count = 0; \
} \
MUTEX_UNLOCK(mutex.lock); \
@@ -310,7 +310,7 @@
do { \
if ((mutex)->readers_count == 0) \
break; \
- COND_WAIT(mutex.zero_readers, mutex.lock); \
+ COND_WAIT(mutex.wakeup, mutex.lock); \
} \
while (1); \
\
@@ -319,20 +319,20 @@
# define PERL_WRITE_UNLOCK(mutex) \
STMT_START { \
- COND_SIGNAL(mutex.readers_now_zero); \
+ COND_SIGNAL(mutex.wakeup); \
MUTEX_UNLOCK(mutex.lock); \
} STMT_END
# define PERL_RW_MUTEX_INIT(mutex) \
STMT_START { \
MUTEX_INIT(mutex.lock); \
- COND_INIT(mutex.zero_readers); \
+ COND_INIT(mutex.wakeup); \
(mutex)->readers_count = 0; \
} STMT_END
# define PERL_RW_MUTEX_DESTROY(mutex) \
STMT_START { \
- COND_DESTROY(mutex.zero_readers); \
+ COND_DESTROY(mutex.wakeup); \
MUTEX_DESTROY(mutex.lock); \
} STMT_END