In perl.git, the branch smoke-me/ilmari/mutex-ifdeffery has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ef0999ffbb37d58474e30035d4a3a82e4391eeb8?hp=3de848eebada810f9671f30f181703e785798d84>

  discards  3de848eebada810f9671f30f181703e785798d84 (commit)
- Log -----------------------------------------------------------------
commit ef0999ffbb37d58474e30035d4a3a82e4391eeb8
Author: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
Date:   Wed Jun 28 14:52:47 2017 +0100

    Use do {} while (0) for NOOP

M       perl.h

commit c8c86e3204173e656ff2bfc5f59690c03ab247a1
Author: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
Date:   Wed Jun 28 14:40:16 2017 +0100

    Properly NOOP thread macros

M       thread.h

commit 2b3ea72128dd597c647bc57864100d375011485f
Author: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
Date:   Tue Jun 27 23:23:45 2017 +0100

    Remove pointless USE_ITHREADS ifdeffery around MUTEX_* calls
    
    These macros are defined as no-ops outside USE_ITHREADS, so there's no
    point in guarding them with it.

M       ext/arybase/arybase.pm
M       ext/arybase/arybase.xs
M       os2/os2.c
M       perlio.c
M       util.c
-----------------------------------------------------------------------

Summary of changes:
 ext/arybase/arybase.pm |  2 +-
 ext/arybase/arybase.xs |  1 -
 perl.h                 |  4 ++--
 thread.h               | 24 ++++++++++++------------
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/ext/arybase/arybase.pm b/ext/arybase/arybase.pm
index 64efe3e5d6..7168ccbf38 100644
--- a/ext/arybase/arybase.pm
+++ b/ext/arybase/arybase.pm
@@ -1,6 +1,6 @@
 package arybase;
 
-our $VERSION = "0.12";
+our $VERSION = "0.13";
 
 require XSLoader;
 XSLoader::load(); # This returns true, which makes require happy.
diff --git a/ext/arybase/arybase.xs b/ext/arybase/arybase.xs
index 3a9a3a5983..2521d4259e 100644
--- a/ext/arybase/arybase.xs
+++ b/ext/arybase/arybase.xs
@@ -401,7 +401,6 @@ BOOT:
     if (!ab_initialized++) {
        ab_op_map = ptable_new();
        MUTEX_INIT(&ab_op_map_mutex);
-
 #define check(uc,lc,ck) \
                wrap_op_checker(OP_##uc, ab_ck_##ck, &ab_old_ck_##lc)
        check(SASSIGN,  sassign,  sassign);
diff --git a/perl.h b/perl.h
index 88c0a3f24a..91d5214703 100644
--- a/perl.h
+++ b/perl.h
@@ -437,14 +437,14 @@
 #  define CLANG_DIAG_RESTORE
 #endif
 
-#define NOOP /*EMPTY*/(void)0
+#define NOOP do {} while (0)
 /* cea2e8a9dd23747f accidentally lost the comment originally from the first
    check in of thread.h, explaining why we need dNOOP at all:  */
 /* Rats: if dTHR is just blank then the subsequent ";" throws an error */
 /* Declaring a *function*, instead of a variable, ensures that we don't rely
    on being able to suppress "unused" warnings.  */
 #ifdef __cplusplus
-#define dNOOP (void)0
+#define dNOOP do {} while (0)
 #else
 #define dNOOP extern int Perl___notused(void)
 #endif
diff --git a/thread.h b/thread.h
index 9958a5bffb..869d294362 100644
--- a/thread.h
+++ b/thread.h
@@ -147,7 +147,7 @@
     } STMT_END
 
 #define THREAD_CREATE(thr, f)  (thr->self = cthread_fork(f, thr), 0)
-#define THREAD_POST_CREATE(thr)
+#define THREAD_POST_CREATE(thr)        NOOP
 
 #define THREAD_RET_TYPE                any_t
 #define THREAD_RET_CAST(x)     ((any_t) x)
@@ -378,47 +378,47 @@
 #endif /* USE_ITHREADS */
 
 #ifndef MUTEX_LOCK
-#  define MUTEX_LOCK(m)
+#  define MUTEX_LOCK(m)           NOOP
 #endif
 
 #ifndef MUTEX_UNLOCK
-#  define MUTEX_UNLOCK(m)
+#  define MUTEX_UNLOCK(m)         NOOP
 #endif
 
 #ifndef MUTEX_INIT
-#  define MUTEX_INIT(m)
+#  define MUTEX_INIT(m)           NOOP
 #endif
 
 #ifndef MUTEX_DESTROY
-#  define MUTEX_DESTROY(m)
+#  define MUTEX_DESTROY(m)        NOOP
 #endif
 
 #ifndef COND_INIT
-#  define COND_INIT(c)
+#  define COND_INIT(c)            NOOP
 #endif
 
 #ifndef COND_SIGNAL
-#  define COND_SIGNAL(c)
+#  define COND_SIGNAL(c)          NOOP
 #endif
 
 #ifndef COND_BROADCAST
-#  define COND_BROADCAST(c)
+#  define COND_BROADCAST(c)       NOOP
 #endif
 
 #ifndef COND_WAIT
-#  define COND_WAIT(c, m)
+#  define COND_WAIT(c, m)         NOOP
 #endif
 
 #ifndef COND_DESTROY
-#  define COND_DESTROY(c)
+#  define COND_DESTROY(c)         NOOP
 #endif
 
 #ifndef LOCK_DOLLARZERO_MUTEX
-#  define LOCK_DOLLARZERO_MUTEX
+#  define LOCK_DOLLARZERO_MUTEX   NOOP
 #endif
 
 #ifndef UNLOCK_DOLLARZERO_MUTEX
-#  define UNLOCK_DOLLARZERO_MUTEX
+#  define UNLOCK_DOLLARZERO_MUTEX NOOP
 #endif
 
 /* THR, SET_THR, and dTHR are there for compatibility with old versions */

--
Perl5 Master Repository

Reply via email to