summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-04-23 15:21:13 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-04-23 15:21:13 (GMT)
commit877509aef43034fec002eeafc9982e4b6c1c0b3d (patch)
tree8395ac5c7b4bae90fb8e7d19c6a3c428ed8c2b5a /Modules
parent00bdbe1d97f5d72f46f955ae886f4a0dbf32f7cb (diff)
downloadcpython-877509aef43034fec002eeafc9982e4b6c1c0b3d.zip
cpython-877509aef43034fec002eeafc9982e4b6c1c0b3d.tar.gz
cpython-877509aef43034fec002eeafc9982e4b6c1c0b3d.tar.bz2
Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
release the GIL. Patch by Charles-François Natali.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 18a67e1..2eb3e92 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3083,9 +3083,7 @@ posix_getpriority(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ii", &which, &who))
return NULL;
errno = 0;
- Py_BEGIN_ALLOW_THREADS
retval = getpriority(which, who);
- Py_END_ALLOW_THREADS
if (errno != 0)
return posix_error();
return PyLong_FromLong((long)retval);
@@ -3105,9 +3103,7 @@ posix_setpriority(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "iii", &which, &who, &prio))
return NULL;
- Py_BEGIN_ALLOW_THREADS
retval = setpriority(which, who, prio);
- Py_END_ALLOW_THREADS
if (retval == -1)
return posix_error();
Py_RETURN_NONE;
@@ -6010,9 +6006,7 @@ posix_dup(PyObject *self, PyObject *args)
return NULL;
if (!_PyVerify_fd(fd))
return posix_error();
- Py_BEGIN_ALLOW_THREADS
fd = dup(fd);
- Py_END_ALLOW_THREADS
if (fd < 0)
return posix_error();
return PyLong_FromLong((long)fd);
@@ -6031,9 +6025,7 @@ posix_dup2(PyObject *self, PyObject *args)
return NULL;
if (!_PyVerify_fd_dup2(fd, fd2))
return posix_error();
- Py_BEGIN_ALLOW_THREADS
res = dup2(fd, fd2);
- Py_END_ALLOW_THREADS
if (res < 0)
return posix_error();
Py_INCREF(Py_None);
@@ -6525,9 +6517,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
HFILE read, write;
APIRET rc;
- Py_BEGIN_ALLOW_THREADS
rc = DosCreatePipe( &read, &write, 4096);
- Py_END_ALLOW_THREADS
if (rc != NO_ERROR)
return os2_error(rc);
@@ -6536,9 +6526,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
#if !defined(MS_WINDOWS)
int fds[2];
int res;
- Py_BEGIN_ALLOW_THREADS
res = pipe(fds);
- Py_END_ALLOW_THREADS
if (res != 0)
return posix_error();
return Py_BuildValue("(ii)", fds[0], fds[1]);
@@ -6546,9 +6534,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
HANDLE read, write;
int read_fd, write_fd;
BOOL ok;
- Py_BEGIN_ALLOW_THREADS
ok = CreatePipe(&read, &write, NULL, 0);
- Py_END_ALLOW_THREADS
if (!ok)
return win32_error("CreatePipe", NULL);
read_fd = _open_osfhandle((Py_intptr_t)read, 0);