Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
9f036b87
Commit
9f036b87
authored
May 24, 2011
by
Alexey Borzenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't ensure GIL in vfd_open() and vfd_free() when called from Python
parent
eef1eeaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
gevent/libev_vfd.h
gevent/libev_vfd.h
+12
-4
No files found.
gevent/libev_vfd.h
View file @
9f036b87
...
@@ -75,7 +75,9 @@ static int vfd_open_(long handle, int pyexc)
...
@@ -75,7 +75,9 @@ static int vfd_open_(long handle, int pyexc)
PyObject
*
key
=
NULL
;
PyObject
*
key
=
NULL
;
PyObject
*
value
;
PyObject
*
value
;
VFD_GIL_ENSURE
;
if
(
!
pyexc
)
{
VFD_GIL_ENSURE
;
}
if
(
ioctlsocket
(
handle
,
FIONREAD
,
&
arg
)
!=
0
)
{
if
(
ioctlsocket
(
handle
,
FIONREAD
,
&
arg
)
!=
0
)
{
if
(
pyexc
)
if
(
pyexc
)
PyErr_Format
(
PyExc_IOError
,
"%ld is not a socket (files are not supported)"
,
handle
);
PyErr_Format
(
PyExc_IOError
,
"%ld is not a socket (files are not supported)"
,
handle
);
...
@@ -136,7 +138,9 @@ allocated:
...
@@ -136,7 +138,9 @@ allocated:
Py_DECREF
(
value
);
Py_DECREF
(
value
);
done:
done:
Py_XDECREF
(
key
);
Py_XDECREF
(
key
);
VFD_GIL_RELEASE
;
if
(
!
pyexc
)
{
VFD_GIL_RELEASE
;
}
return
fd
;
return
fd
;
}
}
...
@@ -148,7 +152,9 @@ static void vfd_free_(int fd, int needclose)
...
@@ -148,7 +152,9 @@ static void vfd_free_(int fd, int needclose)
VFD_GIL_DECLARE
;
VFD_GIL_DECLARE
;
PyObject
*
key
;
PyObject
*
key
;
VFD_GIL_ENSURE
;
if
(
needclose
)
{
VFD_GIL_ENSURE
;
}
if
(
fd
<
0
||
fd
>=
vfd_num
)
if
(
fd
<
0
||
fd
>=
vfd_num
)
goto
done
;
/* out of bounds */
goto
done
;
/* out of bounds */
if
(
vfd_entries
[
fd
].
count
<=
0
)
if
(
vfd_entries
[
fd
].
count
<=
0
)
...
@@ -167,7 +173,9 @@ static void vfd_free_(int fd, int needclose)
...
@@ -167,7 +173,9 @@ static void vfd_free_(int fd, int needclose)
Py_DECREF
(
key
);
Py_DECREF
(
key
);
}
}
done:
done:
VFD_GIL_RELEASE
;
if
(
needclose
)
{
VFD_GIL_RELEASE
;
}
}
}
#define vfd_free(fd) vfd_free_((fd), 0)
#define vfd_free(fd) vfd_free_((fd), 0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment