Library
-------
+- The '_ctypes' extension module now works when Python is configured
+ with the --without-threads option.
+
- Bug #1504333: Make sgmllib support angle brackets in quoted
attribute values.
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
PyEval_InitThreads();
+#endif
m = Py_InitModule3("_ctypes", module_methods, module_docs);
if (!m)
return;
PyObject *result;
PyObject *arglist = NULL;
int nArgs;
+#ifdef WITH_THREADS
PyGILState_STATE state = PyGILState_Ensure();
+#endif
nArgs = PySequence_Length(converters);
/* Hm. What to return in case of error?
Py_XDECREF(result);
Done:
Py_XDECREF(arglist);
-
+#ifdef WITH_THREADS
PyGILState_Release(state);
+#endif
}
static void closure_fcn(ffi_cif *cif,
LPVOID *ppv)
{
long result;
+#ifdef WITH_THREADS
PyGILState_STATE state;
+#endif
LoadPython();
+#ifdef WITH_THREADS
state = PyGILState_Ensure();
+#endif
result = Call_GetClassObject(rclsid, riid, ppv);
+#ifdef WITH_THREADS
PyGILState_Release(state);
+#endif
return result;
}
STDAPI DllCanUnloadNow(void)
{
long result;
+#ifdef WITH_THREADS
PyGILState_STATE state = PyGILState_Ensure();
+#endif
result = Call_CanUnloadNow();
+#ifdef WITH_THREADS
PyGILState_Release(state);
+#endif
return result;
}
void *resmem,
int argcount)
{
+#ifdef WITH_THREADS
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
+#endif
ffi_cif cif;
int cc;
#ifdef MS_WIN32
return -1;
}
+#ifdef WITH_THREADS
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_UNBLOCK_THREADS
+#endif
#ifdef MS_WIN32
#ifndef DONT_USE_SEH
__try {
}
#endif
#endif
+#ifdef WITH_THREADS
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_BLOCK_THREADS
+#endif
#ifdef MS_WIN32
#ifndef DONT_USE_SEH
if (dwExceptionCode) {