Kaydet (Commit) c55485bc authored tarafından Gregory P. Smith's avatar Gregory P. Smith

use PyBUF_LOCK instead of PyBUF_SIMPLE for bsddb data access as it'll often

be using the data buffer provided without the GIL held.
üst 74ca557e
......@@ -312,10 +312,9 @@ static Py_buffer * _malloc_view(PyObject *obj)
"Py_buffer malloc failed");
return NULL;
}
/* XXX(gps): PyBUF_LOCKDATA is desired to prevent other theads from
trashing the data buffer while we release the GIL during the db
operation. see http://bugs.python.org/issue1035 */
if (PyObject_GetBuffer(obj, view, PyBUF_SIMPLE) == -1) {
/* We use PyBUF_LOCK to prevent other threads from trashing the data
buffer while we release the GIL. http://bugs.python.org/issue1035 */
if (PyObject_GetBuffer(obj, view, PyBUF_LOCK) == -1) {
PyMem_Free(view);
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment