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
bfe5bb68
Commit
bfe5bb68
authored
Aug 30, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Greenlet: set _start_event if greenlet was killed or switched to
parent
72e94e75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
gevent/greenlet.py
gevent/greenlet.py
+19
-3
No files found.
gevent/greenlet.py
View file @
bfe5bb68
...
...
@@ -216,7 +216,9 @@ class Greenlet(greenlet):
a) cancel the event that will start it
b) fire the notifications as if an exception was raised in a greenlet
"""
if
self
.
_start_event
is
not
None
:
if
self
.
_start_event
is
None
:
self
.
_start_event
=
_dummy_event
else
:
self
.
_start_event
.
stop
()
try
:
greenlet
.
throw
(
self
,
*
args
)
...
...
@@ -297,7 +299,9 @@ class Greenlet(greenlet):
`Changed in version 0.13.0:` *block* is now ``True`` by default.
"""
if
self
.
_start_event
is
not
None
:
if
self
.
_start_event
is
None
:
self
.
_start_event
=
_dummy_event
else
:
self
.
_start_event
.
stop
()
if
not
self
.
dead
:
waiter
=
Waiter
()
...
...
@@ -390,7 +394,10 @@ class Greenlet(greenlet):
def
run
(
self
):
try
:
self
.
_start_event
.
stop
()
if
self
.
_start_event
is
None
:
self
.
_start_event
=
_dummy_event
else
:
self
.
_start_event
.
stop
()
try
:
result
=
self
.
_run
(
*
self
.
args
,
**
self
.
kwargs
)
except
:
...
...
@@ -473,6 +480,15 @@ class Greenlet(greenlet):
self
.
parent
.
handle_error
((
link
,
self
),
*
sys
.
exc_info
())
class
_dummy_event
(
object
):
def
stop
(
self
):
pass
_dummy_event
=
_dummy_event
()
def
_kill
(
greenlet
,
exception
,
waiter
):
try
:
greenlet
.
throw
(
exception
)
...
...
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