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
63b3e8a9
Commit
63b3e8a9
authored
Aug 03, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify joinall and remove _joinall
parent
5da85b40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
gevent/greenlet.py
gevent/greenlet.py
+9
-16
No files found.
gevent/greenlet.py
View file @
63b3e8a9
...
...
@@ -127,7 +127,7 @@ def killall(greenlets, exception=GreenletExit, block=False, polling_period=0.2):
if
block
:
alive
=
waiter
.
wait
()
if
alive
:
_
joinall
(
alive
,
polling_period
=
polling_period
)
joinall
(
alive
,
polling_period
=
polling_period
)
def
join
(
greenlet
,
polling_period
=
0.2
):
...
...
@@ -138,24 +138,17 @@ def join(greenlet, polling_period=0.2):
sleep
(
delay
)
def
_joinall
(
greenlets
,
polling_period
=
0.2
):
"""Wait for the greenlets to finish by polling their status.
WARNING: greenlets argument is corrupted.
"""
while
greenlets
and
greenlets
[
0
].
dead
:
del
greenlets
[
0
]
def
joinall
(
greenlets
,
polling_period
=
0.2
):
"""Wait for the greenlets to finish by polling their status"""
current
=
0
while
current
<
len
(
greenlets
)
and
greenlets
[
current
].
dead
:
current
+=
1
delay
=
0.002
while
greenlets
:
while
current
<
len
(
greenlets
)
:
delay
=
min
(
polling_period
,
delay
*
2
)
sleep
(
delay
)
while
greenlets
and
greenlets
[
-
1
].
dead
:
del
greenlets
[
-
1
]
def
joinall
(
greenlets
,
polling_period
=
0.2
):
"""Wait for the greenlets to finish by polling their status"""
return
_joinall
(
list
(
greenlets
),
polling_period
=
polling_period
)
while
current
<
len
(
greenlets
)
and
greenlets
[
current
].
dead
:
current
+=
1
try
:
...
...
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