Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4215d273
Commit
4215d273
authored
Jun 18, 2012
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15101: Make pool finalizer avoid joining current thread
parent
48ee6908
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Lib/multiprocessing/pool.py
Lib/multiprocessing/pool.py
+6
-3
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/multiprocessing/pool.py
View file @
4215d273
...
...
@@ -489,7 +489,8 @@ class Pool(object):
# We must wait for the worker handler to exit before terminating
# workers because we don't want workers to be restarted behind our back.
debug
(
'joining worker handler'
)
worker_handler
.
join
()
if
threading
.
current_thread
()
is
not
worker_handler
:
worker_handler
.
join
(
1e100
)
# Terminate workers which haven't already finished.
if
pool
and
hasattr
(
pool
[
0
],
'terminate'
):
...
...
@@ -499,10 +500,12 @@ class Pool(object):
p
.
terminate
()
debug
(
'joining task handler'
)
task_handler
.
join
(
1e100
)
if
threading
.
current_thread
()
is
not
task_handler
:
task_handler
.
join
(
1e100
)
debug
(
'joining result handler'
)
result_handler
.
join
(
1e100
)
if
threading
.
current_thread
()
is
not
result_handler
:
result_handler
.
join
(
1e100
)
if
pool
and
hasattr
(
pool
[
0
],
'terminate'
):
debug
(
'joining pool workers'
)
...
...
Misc/NEWS
View file @
4215d273
...
...
@@ -67,6 +67,8 @@ Core and Builtins
Library
-------
-
Issue
#
15101
:
Make
pool
finalizer
avoid
joining
current
thread
.
-
Issue
#
15054
:
A
bug
in
tokenize
.
tokenize
that
caused
string
literals
with
'b'
and
'br'
prefixes
to
be
incorrectly
tokenized
has
been
fixed
.
Patch
by
Serhiy
Storchaka
.
...
...
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