summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTravis E. Oliphant <oliphant@enthought.com>2008-06-06 20:52:38 (GMT)
committerTravis E. Oliphant <oliphant@enthought.com>2008-06-06 20:52:38 (GMT)
commit3900088cb6d70769c7905ea0afa8b6f161186fde (patch)
tree7cb5be0660b0801312b26202635b24f9e977cf73 /Modules
parentb2750b5d334e9c8d262009069bce41c15803eca0 (diff)
downloadcpython-3900088cb6d70769c7905ea0afa8b6f161186fde.zip
cpython-3900088cb6d70769c7905ea0afa8b6f161186fde.tar.gz
cpython-3900088cb6d70769c7905ea0afa8b6f161186fde.tar.bz2
Remove locking from buffer protocol as-per discussion.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c6
-rw-r--r--Modules/_ctypes/_ctypes.c5
-rw-r--r--Modules/arraymodule.c5
3 files changed, 0 insertions, 16 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 04c3835..3a67a1e 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -312,12 +312,6 @@ static Py_buffer * _malloc_view(PyObject *obj)
"Py_buffer malloc failed");
return NULL;
}
- /* 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;
- }
if (view->ndim > 1) {
PyErr_SetString(PyExc_BufferError,
"buffers must be single dimension");
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index fe598d7..c840757 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2449,11 +2449,6 @@ static int CData_GetBuffer(PyObject *_self, Py_buffer *view, int flags)
Py_ssize_t i;
if (view == NULL) return 0;
- if (((flags & PyBUF_LOCK) == PyBUF_LOCK)) {
- PyErr_SetString(PyExc_BufferError,
- "Cannot lock this object.");
- return -1;
- }
view->buf = self->b_ptr;
view->len = self->b_size;
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index a84126d..ea59a42 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1779,11 +1779,6 @@ static const void *emptybuf = "";
static int
array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags)
{
- if ((flags & PyBUF_LOCK)) {
- PyErr_SetString(PyExc_BufferError,
- "Cannot lock data");
- return -1;
- }
if (view==NULL) goto finish;
view->buf = (void *)self->ob_item;