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
be372d26
Commit
be372d26
authored
May 09, 2020
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
619e3d5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/gevent/libuv/loop.py
src/gevent/libuv/loop.py
+11
-0
No files found.
src/gevent/libuv/loop.py
View file @
be372d26
...
...
@@ -10,6 +10,9 @@ from collections import namedtuple
from
operator
import
delitem
import
signal
from
gevent
import
getcurrent
from
gevent.exceptions
import
LoopExit
from
gevent._ffi
import
_dbg
# pylint: disable=unused-import
from
gevent._ffi.loop
import
AbstractLoop
from
gevent._ffi.loop
import
assign_standard_callbacks
...
...
@@ -187,6 +190,14 @@ class loop(AbstractLoop):
libuv
.
uv_unref
(
self
.
_signal_idle
)
def
_run_callbacks
(
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
# safe to go back to C (Windows in particular can abort
# the process with "GetQueuedCompletionStatusEx: (6) The
# handle is invalid.") So switch to the parent greenlet.
getcurrent
().
parent
.
throw
(
LoopExit
(
'Destroyed during run'
))
# Manually handle fork watchers.
curpid
=
os
.
getpid
()
if
curpid
!=
self
.
_pid
:
...
...
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