minor cleanup of thread-init code
authorStefan Behnel <scoder@users.berlios.de>
Thu, 19 Mar 2009 10:35:54 +0000 (11:35 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 19 Mar 2009 10:35:54 +0000 (11:35 +0100)
Cython/Compiler/ModuleNode.py
Cython/Compiler/Nodes.py

index ddb9b6b399444a4f5d042db07755e5a5ffe94700..937240d0360d63ee5bcb5fc9aeadf83576ff0cfc 100644 (file)
@@ -1606,7 +1606,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
 
         code.putln("/*--- Threads initialization code ---*/")
         code.putln("#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS")
-        code.putln("#ifdef WITH_THREAD")
+        code.putln("#ifdef WITH_THREAD /* Python build with threading support? */")
         code.putln("PyEval_InitThreads();")
         code.putln("#endif")
         code.putln("#endif")
index 9634b9144017873458d95b40b39ba00b20343b1f..d9254ad0ad7709b871edcaa6c391de3ea14c632d 100644 (file)
@@ -5627,10 +5627,10 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
 py23_init_threads_utility_code = UtilityCode(
 proto="""
 #ifndef __PYX_FORCE_INIT_THREADS
-#define __PYX_FORCE_INIT_THREADS 0
-#if PY_VERSION_HEX < 0x02040000
-#undef  __PYX_FORCE_INIT_THREADS
+#if PY_VERSION_HEX < 0x02040200
 #define __PYX_FORCE_INIT_THREADS 1
+#else
+#define __PYX_FORCE_INIT_THREADS 0
 #endif
 #endif
 """)