Skip to content

Backport thread_name_prefix from upstream#64

Merged
agronholm merged 2 commits intoagronholm:masterfrom
sseg:backport_issue_27664
Aug 8, 2017
Merged

Backport thread_name_prefix from upstream#64
agronholm merged 2 commits intoagronholm:masterfrom
sseg:backport_issue_27664

Conversation

@sseg
Copy link
Copy Markdown
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
Comment thread concurrent/futures/thread.py Outdated
self._threads = set()
self._shutdown = False
self._shutdown_lock = threading.Lock()
self._thread_name_prefix = thread_name_prefix
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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