Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

@MartinNowak
Copy link
Member

  • make thread_init/term @nogc
  • move thread_init/term from GC to rt_init/term

- needed to replace destroy with manual destruction
- use custom monitor deletion that does not call any event hooks
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @MartinNowak!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Contributor

wilzbach commented Feb 7, 2018

21.052% of diff hit (target 74.653%)

Let's make it pass -> #2080

Copy link
Member

@schveiguy schveiguy left a comment

Choose a reason for hiding this comment

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

Nice! I think this is a much more straightforward solution.

Thread.sm_main.__dtor();
_d_monitordelete_nogc(Thread.sm_main);
if (typeid(Thread).initializer.ptr)
_mainThreadStore[] = typeid(Thread).initializer[];
Copy link
Member

Choose a reason for hiding this comment

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

A couple comments here:

My coverage analysis is saying this code is never run.

The normal destroy will nullify the vtable, and also if the initializer.ptr is null, it means you should zero the data. But I don't actually think you need to check if it's null, as it should always have a vtable in the initializer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Coverage messurement fails here because this is run outside of the main loop, i.e. after coverage is collected and reported.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, you can easily fixup or edit PRs. Much less hassle than asking for single-line changes.

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

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

This is superb work. Thanks!

@somzzz
Copy link
Contributor

somzzz commented Feb 7, 2018

Squash please.

Then I will adjust my PR. Thanks!

@andralex
Copy link
Member

Coverage needs to be looked at but I'll merge this to unblock @somzzz who is in a bit of time crunch.

@andralex andralex merged commit 32409f5 into dlang:master Feb 12, 2018
@MartinNowak MartinNowak deleted the nogc_thread_init branch February 13, 2018 15:33
@MartinNowak
Copy link
Member Author

No need to squash here, these are 3 separate steps (commits) that together form one particular change.
Having them as separate commits allows to review things piecewise and leaves more context in the git history.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants