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
42ae54c3
Commit
42ae54c3
authored
4 years ago
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More safely handle getting a callback from libuv once we're destroyed.
parent
be372d26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/gevent/libuv/loop.py
src/gevent/libuv/loop.py
+5
-1
No files found.
src/gevent/libuv/loop.py
View file @
42ae54c3
...
...
@@ -189,7 +189,7 @@ class loop(AbstractLoop):
self
.
SIGNAL_CHECK_INTERVAL_MS
)
libuv
.
uv_unref
(
self
.
_signal_idle
)
def
_
run_callbacks
(
self
):
def
_
_check_and_die
(
self
):
if
not
self
.
ptr
:
# We've been destroyed during the middle of self.run().
# This method is being called into from C, and it's not
...
...
@@ -198,6 +198,8 @@ class loop(AbstractLoop):
# handle is invalid.") So switch to the parent greenlet.
getcurrent
().
parent
.
throw
(
LoopExit
(
'Destroyed during run'
))
def
_run_callbacks
(
self
):
self
.
__check_and_die
()
# Manually handle fork watchers.
curpid
=
os
.
getpid
()
if
curpid
!=
self
.
_pid
:
...
...
@@ -574,6 +576,7 @@ class loop(AbstractLoop):
return
result
def
now
(
self
):
self
.
__check_and_die
()
# libuv's now is expressed as an integer number of
# milliseconds, so to get it compatible with time.time units
# that this method is supposed to return, we have to divide by 1000.0
...
...
@@ -581,6 +584,7 @@ class loop(AbstractLoop):
return
now
/
1000.0
def
update_now
(
self
):
self
.
__check_and_die
()
libuv
.
uv_update_time
(
self
.
ptr
)
def
fileno
(
self
):
...
...
This diff is collapsed.
Click to expand it.
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