Skip to content

bpo-16500: Use register_at_fork() in the threading module#1843

Merged
pitrou merged 3 commits into
python:masterfrom
pitrou:register_at_fork_threading
May 28, 2017
Merged

bpo-16500: Use register_at_fork() in the threading module#1843
pitrou merged 3 commits into
python:masterfrom
pitrou:register_at_fork_threading

Conversation

@pitrou

@pitrou pitrou commented May 28, 2017

Copy link
Copy Markdown
Member

No description provided.

@mention-bot

Copy link
Copy Markdown

@pitrou, thanks for your PR! By analyzing the history of the files in this pull request, we identified @serhiy-storchaka, @brettcannon and @benjaminp to be potential reviewers.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Comments in _after_fork() should be updated again.

Is it good that _after_fork() is called after _PyThreadState_DeleteExcept(current_tstate) and _PyImport_ReInitLock()?

@pitrou

pitrou commented May 28, 2017

Copy link
Copy Markdown
Member Author

Is it good that _after_fork() is called after _PyThreadState_DeleteExcept(current_tstate) and _PyImport_ReInitLock()?

Being called after _PyImport_ReInitLock() is certainly a good thing. Being called after _PyThreadState_DeleteExcept() should be ok too, especially given _after_fork merely reinitializes a couple of locks and unregisters dead Thread objects from the global threads list.

@pitrou pitrou merged commit 4a8bcdf into python:master May 28, 2017
Comment thread Lib/threading.py
exc_tb.tb_frame.f_code.co_name)), file=self._stderr)
exc_tb = exc_tb.tb_next
print(("%s: %s" % (exc_type, exc_value)), file=self._stderr)
self._stderr.flush()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just pass flush=True to the print() above.

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.

5 participants