diff options
author | Tony Cook <tony@develop-help.com> | 2020-12-14 15:20:17 +1100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-14 13:25:17 -0700 |
commit | 13d2ab8bbbcb68824b0e53e403df7b9dd3ec55d5 (patch) | |
tree | 64c4fb90cd28500a43dc59e449fac6686890d8e6 | |
parent | eb6cdcc1bc6ec3836d18f0a4f068a835934eb6e4 (diff) | |
download | perl-13d2ab8bbbcb68824b0e53e403df7b9dd3ec55d5.tar.gz |
build test for the read/write mutex macros
This fails to compile
-rw-r--r-- | ext/XS-APItest/APItest.xs | 25 | ||||
-rw-r--r-- | thread.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 549bf54afd..acfbe22a5c 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -6936,6 +6936,31 @@ Comctl32Version() #endif +MODULE = XS::APItest PACKAGE = XS::APItest::RWMacro + +#if defined(USE_ITHREADS) + +void +compile_macros() + PREINIT: + perl_RnW1_mutex_t m; + perl_RnW1_mutex_t *pm = &m; + CODE: + PERL_RW_MUTEX_INIT(&m); + PERL_WRITE_LOCK(&m); + PERL_WRITE_UNLOCK(&m); + PERL_READ_LOCK(&m); + PERL_READ_UNLOCK(&m); + PERL_RW_MUTEX_DESTROY(&m); + PERL_RW_MUTEX_INIT(pm); + PERL_WRITE_LOCK(pm); + PERL_WRITE_UNLOCK(pm); + PERL_READ_LOCK(pm); + PERL_READ_UNLOCK(pm); + PERL_RW_MUTEX_DESTROY(pm); + +#endif + MODULE = XS::APItest PACKAGE = XS::APItest::HvMacro @@ -472,6 +472,8 @@ # define PERL_READ_UNLOCK NOOP # define PERL_WRITE_LOCK NOOP # define PERL_WRITE_UNLOCK NOOP +# define PERL_RW_MUTEX_INIT NOOP +# define PERL_RW_MUTEX_DESTROY NOOP #endif #ifndef LOCK_DOLLARZERO_MUTEX |