Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport thread_name_prefix from upstream #64

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

sseg
Copy link
Contributor

@sseg sseg commented Jul 26, 2017

Add optional thread_name_prefix argument to constructor of ThreadPoolExecutor.
Resolves #63

cc @agronholm @gpshead

Add optional `thread_name_prefix` argument to constructor of
ThreadPoolExecutor. Resolves agronholm#63
@@ -109,6 +110,7 @@ def __init__(self, max_workers=None):
self._threads = set()
self._shutdown = False
self._shutdown_lock = threading.Lock()
self._thread_name_prefix = thread_name_prefix
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR seems incomplete. This part of the code differs from upstream: https://github.com/python/cpython/blob/master/Lib/concurrent/futures/thread.py#L109-L110

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed that. It seems to be from a more recent fix (python/cpython#2315) which should nevertheless be included here. I'll apply the second patch in another commit on this branch.

@agronholm
Copy link
Owner

The tests fail. Please fix the code. I will merge it then.

@sseg sseg force-pushed the backport_issue_27664 branch 2 times, most recently from c909643 to d16bb53 Compare August 8, 2017 13:54
@agronholm agronholm merged commit e8543e6 into agronholm:master Aug 8, 2017
@agronholm
Copy link
Owner

Thanks!

@sseg sseg deleted the backport_issue_27664 branch August 8, 2017 15:47
li-dan pushed a commit to li-dan/typeshed that referenced this pull request Jun 18, 2018
The thread_name_prefix argument of ThreadPoolExecutor.__init__ was added
to the Python 2 backport in agronholm/pythonfutures#64.
JelleZijlstra pushed a commit to python/typeshed that referenced this pull request Jun 18, 2018
The thread_name_prefix argument of ThreadPoolExecutor.__init__ was added
to the Python 2 backport in agronholm/pythonfutures#64.
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
The thread_name_prefix argument of ThreadPoolExecutor.__init__ was added
to the Python 2 backport in agronholm/pythonfutures#64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backport: Issue #27664: Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor
2 participants