summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/thread.h b/thread.h
index 5a2b3af619..474c2b43b6 100644
--- a/thread.h
+++ b/thread.h
@@ -221,13 +221,16 @@
RESTORE_ERRNO; \
} STMT_END
-# define MUTEX_DESTROY(m) \
- STMT_START { \
- int _eC_; \
- if ((_eC_ = pthread_mutex_destroy((m)))) { \
- Perl_croak_nocontext("panic: MUTEX_DESTROY (%d) [%s:%d]", \
- _eC_, __FILE__, __LINE__); \
- } \
+# define MUTEX_DESTROY(m) \
+ STMT_START { \
+ int _eC_; \
+ if ((_eC_ = pthread_mutex_destroy((m)))) { \
+ dTHX; \
+ if (PL_phase != PERL_PHASE_DESTRUCT) { \
+ Perl_croak_nocontext("panic: MUTEX_DESTROY (%d) [%s:%d]", \
+ _eC_, __FILE__, __LINE__); \
+ } \
+ } \
} STMT_END
#endif /* MUTEX_INIT */
@@ -265,11 +268,15 @@
} STMT_END
# define COND_DESTROY(c) \
- STMT_START { \
- int _eC_; \
- if ((_eC_ = pthread_cond_destroy((c)))) \
- Perl_croak_nocontext("panic: COND_DESTROY (%d) [%s:%d]", \
- _eC_, __FILE__, __LINE__); \
+ STMT_START { \
+ int _eC_; \
+ if ((_eC_ = pthread_cond_destroy((c)))) { \
+ dTHX; \
+ if (PL_phase != PERL_PHASE_DESTRUCT) { \
+ Perl_croak_nocontext("panic: COND_DESTROY (%d) [%s:%d]", \
+ _eC_, __FILE__, __LINE__); \
+ } \
+ } \
} STMT_END
#endif /* COND_INIT */