[Python-checkins] r50713 - python/trunk/Modules/_ctypes/callbacks.c python/trunk/Modules/_ctypes/callproc.c

Andrew MacIntyre andymac at bullseye.apana.org.au
Wed Jul 19 12:18:03 CEST 2006


thomas.heller wrote:
> Author: thomas.heller
> Date: Wed Jul 19 11:09:32 2006
> New Revision: 50713
> 
> Modified:
>    python/trunk/Modules/_ctypes/callbacks.c
>    python/trunk/Modules/_ctypes/callproc.c
> Log:
> Make sure the _ctypes extension can be compiled when WITH_THREAD is
> not defined on Windows, even if that configuration is probably not
> supported at all.
> 
> 
> Modified: python/trunk/Modules/_ctypes/callbacks.c
> ==============================================================================
> --- python/trunk/Modules/_ctypes/callbacks.c	(original)
> +++ python/trunk/Modules/_ctypes/callbacks.c	Wed Jul 19 11:09:32 2006
> @@ -348,7 +348,9 @@
>  static void LoadPython(void)
>  {
>  	if (!Py_IsInitialized()) {
> +#ifdef WITH_THREAD
>  		PyEval_InitThreads();
> +#endif
>  		Py_Initialize();
>  	}
>  }
> 
> Modified: python/trunk/Modules/_ctypes/callproc.c
> ==============================================================================
> --- python/trunk/Modules/_ctypes/callproc.c	(original)
> +++ python/trunk/Modules/_ctypes/callproc.c	Wed Jul 19 11:09:32 2006
> @@ -818,7 +818,9 @@
>  	/* We absolutely have to release the GIL during COM method calls,
>  	   otherwise we may get a deadlock!
>  	*/
> +#ifdef WITH_THREAD
>  	Py_BEGIN_ALLOW_THREADS
> +#endif
>  
>  	hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
>  	if (FAILED(hr))
> @@ -842,7 +844,9 @@
>  	pei->lpVtbl->Release(pei);
>  
>    failed:
> +#ifdef WITH_THREAD
>  	Py_END_ALLOW_THREADS
> +#endif
>  
>  	progid = NULL;
>  	ProgIDFromCLSID(&guid, &progid);

Umm... the Py_[BEGIN|END]_ALLOW_THREADS macros shouldn't need to be
#ifdef'ed like this surely?  There's already an #ifdef WITH_THREAD in
Include/ceval.h to (hopefully) correctly redefine them appropriately.

-- 
-------------------------------------------------------------------------
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen ACT 2616
Web:    http://www.andymac.org/               |        Australia


More information about the Python-checkins mailing list