[Python-checkins] r50617 - in python/trunk: Misc/NEWS Modules/_ctypes/_ctypes.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c
thomas.heller
python-checkins at python.org
Thu Jul 13 11:53:48 CEST 2006
Author: thomas.heller
Date: Thu Jul 13 11:53:47 2006
New Revision: 50617
Modified:
python/trunk/Misc/NEWS
python/trunk/Modules/_ctypes/_ctypes.c
python/trunk/Modules/_ctypes/callbacks.c
python/trunk/Modules/_ctypes/callproc.c
Log:
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Thu Jul 13 11:53:47 2006
@@ -28,6 +28,9 @@
- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
default mode for loading shared libraries in ctypes.
+- Because of a misspelled preprocessor symbol, ctypes was always
+ compiled without thread support; this is now fixed.
+
What's New in Python 2.5 beta 2?
================================
Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c (original)
+++ python/trunk/Modules/_ctypes/_ctypes.c Thu Jul 13 11:53:47 2006
@@ -4561,7 +4561,7 @@
ob_type is the metatype (the 'type'), defaults to PyType_Type,
tp_base is the base type, defaults to 'object' aka PyBaseObject_Type.
*/
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyEval_InitThreads();
#endif
m = Py_InitModule3("_ctypes", module_methods, module_docs);
Modified: python/trunk/Modules/_ctypes/callbacks.c
==============================================================================
--- python/trunk/Modules/_ctypes/callbacks.c (original)
+++ python/trunk/Modules/_ctypes/callbacks.c Thu Jul 13 11:53:47 2006
@@ -127,7 +127,7 @@
PyObject *result;
PyObject *arglist = NULL;
int nArgs;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state = PyGILState_Ensure();
#endif
@@ -237,7 +237,7 @@
Py_XDECREF(result);
Done:
Py_XDECREF(arglist);
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
}
@@ -400,16 +400,16 @@
LPVOID *ppv)
{
long result;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state;
#endif
LoadPython();
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
state = PyGILState_Ensure();
#endif
result = Call_GetClassObject(rclsid, riid, ppv);
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
return result;
@@ -463,11 +463,11 @@
STDAPI DllCanUnloadNow(void)
{
long result;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state = PyGILState_Ensure();
#endif
result = Call_CanUnloadNow();
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
return result;
Modified: python/trunk/Modules/_ctypes/callproc.c
==============================================================================
--- python/trunk/Modules/_ctypes/callproc.c (original)
+++ python/trunk/Modules/_ctypes/callproc.c Thu Jul 13 11:53:47 2006
@@ -617,7 +617,7 @@
void *resmem,
int argcount)
{
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
#endif
ffi_cif cif;
@@ -651,7 +651,7 @@
return -1;
}
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_UNBLOCK_THREADS
#endif
@@ -671,7 +671,7 @@
}
#endif
#endif
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_BLOCK_THREADS
#endif
More information about the Python-checkins
mailing list