summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thread.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/thread.h b/thread.h
index eafb75e6fa..96430b95e2 100644
--- a/thread.h
+++ b/thread.h
@@ -319,6 +319,19 @@
# define PERL_WRITE_UNLOCK(mutex) MUTEX_UNLOCK(mutex.lock)
+# define PERL_RW_MUTEX_INIT(mutex) \
+ STMT_START { \
+ MUTEX_INIT(mutex.lock); \
+ COND_INIT(mutex.zero_readers); \
+ (mutex)->readers_count = 0; \
+ } STMT_END
+
+# define PERL_RW_MUTEX_DESTROY(mutex) \
+ STMT_START { \
+ COND_DESTROY(mutex.zero_readers); \
+ MUTEX_DESTROY(mutex.lock); \
+ } STMT_END
+
#endif
/* DETACH(t) must only be called while holding t->mutex */