Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(36428)

Unified Diff: Modules/_ctypes/callbacks.c

Issue 10915: Make the PyGILState API compatible with multiple interpreters
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Include/pystate.h ('k') | Modules/_ctypes/ctypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Modules/_ctypes/callbacks.c
===================================================================
--- Modules/_ctypes/callbacks.c (révision 88020)
+++ Modules/_ctypes/callbacks.c (copie de travail)
@@ -151,6 +151,7 @@
static void _CallPythonObject(void *mem,
ffi_type *restype,
SETFUNC setfunc,
+ PyInterpreterState *interp,
PyObject *callable,
PyObject *converters,
int flags,
@@ -163,7 +164,7 @@
PyObject *error_object = NULL;
int *space;
#ifdef WITH_THREAD
- PyGILState_STATE state = PyGILState_Ensure();
+ PyGILState_STATE state = PyGILState_EnsureEx(interp);
#endif
nArgs = PySequence_Length(converters);
@@ -307,7 +308,7 @@
Done:
Py_XDECREF(arglist);
#ifdef WITH_THREAD
- PyGILState_Release(state);
+ PyGILState_ReleaseEx(interp, state);
#endif
}
@@ -321,6 +322,7 @@
_CallPythonObject(resp,
p->ffi_restype,
p->setfunc,
+ p->interp,
p->callable,
p->converters,
p->flags,
@@ -338,6 +340,7 @@
return NULL;
}
+ p->interp = PyThreadState_Get()->interp;
p->pcl_exec = NULL;
p->pcl_write = NULL;
memset(&p->cif, 0, sizeof(p->cif));
« no previous file with comments | « Include/pystate.h ('k') | Modules/_ctypes/ctypes.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+