]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Allow disabling thread safety in Makefile.PL
authorVincent Pit <vince@profvince.com>
Tue, 14 Apr 2015 16:50:58 +0000 (13:50 -0300)
committerVincent Pit <vince@profvince.com>
Tue, 14 Apr 2015 16:50:58 +0000 (13:50 -0300)
Note that thread safety still cannot be forcefully enabled if the necessary
macros are not defined.

Magic.xs

index 947ae72a0246b945f2759deaaa5cbff9afe43382..e6c2fdfb937b1e3f691af80edbdd896a31cf8921 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -62,7 +62,9 @@
 #endif
 
 #if VMG_MULTIPLICITY && defined(USE_ITHREADS) && defined(dMY_CXT) && defined(MY_CXT) && defined(START_MY_CXT) && defined(MY_CXT_INIT) && (defined(MY_CXT_CLONE) || defined(dMY_CXT_SV))
-# define VMG_THREADSAFE 1
+# ifndef VMG_THREADSAFE
+#  define VMG_THREADSAFE 1
+# endif
 # ifndef MY_CXT_CLONE
 #  define MY_CXT_CLONE \
     dMY_CXT_SV;                                                      \
@@ -71,6 +73,7 @@
     sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
 # endif
 #else
+# undef  VMG_THREADSAFE
 # define VMG_THREADSAFE 0
 # undef  dMY_CXT
 # define dMY_CXT      dNOOP