From: Thomas Heller Date: Thu, 13 Jul 2006 09:53:47 +0000 (+0000) Subject: A misspelled preprocessor symbol caused ctypes to be always compiled X-Git-Tag: v2.5b3~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4dc2ef5dacf833327f0db4b9acf8761e1f7b21b;p=python A misspelled preprocessor symbol caused ctypes to be always compiled without thread support. Replaced WITH_THREADS with WITH_THREAD. --- diff --git a/Misc/NEWS b/Misc/NEWS index e12f07fd59..516e84ccf4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -28,6 +28,9 @@ Extension Modules - 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? ================================ diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index dd5c717bb5..2cbd5d593b 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -4561,7 +4561,7 @@ init_ctypes(void) 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); diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index 9d08f1a3dc..55ba5f0c0b 100644 --- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -127,7 +127,7 @@ static void _CallPythonObject(void *mem, PyObject *result; PyObject *arglist = NULL; int nArgs; -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_STATE state = PyGILState_Ensure(); #endif @@ -237,7 +237,7 @@ if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print() Py_XDECREF(result); Done: Py_XDECREF(arglist); -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_Release(state); #endif } @@ -400,16 +400,16 @@ STDAPI DllGetClassObject(REFCLSID rclsid, 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 @@ long Call_CanUnloadNow(void) 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; diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 16e10dedad..0fe7d103ff 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -617,7 +617,7 @@ static int _call_function_pointer(int flags, 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 @@ static int _call_function_pointer(int flags, return -1; } -#ifdef WITH_THREADS +#ifdef WITH_THREAD if ((flags & FUNCFLAG_PYTHONAPI) == 0) Py_UNBLOCK_THREADS #endif @@ -671,7 +671,7 @@ static int _call_function_pointer(int flags, } #endif #endif -#ifdef WITH_THREADS +#ifdef WITH_THREAD if ((flags & FUNCFLAG_PYTHONAPI) == 0) Py_BLOCK_THREADS #endif