Skip to content

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

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

Merged
merged 3 commits into from
May 28, 2017

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented May 28, 2017

No description provided.

@mention-bot
Copy link

@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
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
Copy link
Member Author

pitrou commented May 28, 2017

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
@@ -943,6 +944,7 @@ def _bootstrap_inner(self):
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
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