summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-03-17 20:16:47 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-03-17 20:16:47 (GMT)
commitc55485bc6d4a22026e12ccc6b772984059468a86 (patch)
treec7b2e7a3a9fa68e169de55d36d26a4f98eeb2af2 /Modules
parent74ca557e1e092822cfb71fe1cf7080a0b1564d80 (diff)
downloadcpython-c55485bc6d4a22026e12ccc6b772984059468a86.zip
cpython-c55485bc6d4a22026e12ccc6b772984059468a86.tar.gz
cpython-c55485bc6d4a22026e12ccc6b772984059468a86.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 52d83ec..02973aa 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -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;
}