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

Fix issue 15917 - std.concurrency module destructor causes useless cr… #4191

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

yazd
Copy link
Contributor

@yazd yazd commented Apr 12, 2016

…eation of new MessageBox.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
15917 std.concurrency module destructor causes useless creation of new MessageBox

@yazd
Copy link
Contributor Author

yazd commented Apr 16, 2016

To help in reviewing the code, what happens is that the module destructor calls TheadInfo.cleanup which in turn calls unregisterMe which, in order to do its job, requires the current thread's Tid. So it calls thisTid, but thisTid constructs a Tid lazily when first called and so it creates a new MessageBox which in turns creates a load of unnecessary stuff.
The solution in this PR is to, instead of using thisTid in unregisterMe, directly check the existence of the Tid using thisInfo.ident (which is used in thisTid).

This bug is indirectly causing this issue in vibe.d. Its fix requires this fix in Phobos.

@schveiguy
Copy link
Member

LGTM. Auto tester seems to be having hiccups with timeouts on freebsd.

@DmitryOlshansky
Copy link
Member

LGTM

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky DmitryOlshansky merged commit 4f18045 into dlang:master Apr 18, 2016
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.

4 participants