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

remove thread.di header #865

Merged
merged 1 commit into from Jul 6, 2014
Merged

Conversation

MartinNowak
Copy link
Member

  • Use extern(D) bindings for the core.thread<->rt.tlsgc
    interface to avoid importing a rt module in core.

@ibuclaw
Copy link
Member

ibuclaw commented Jul 5, 2014

Wow.

@ibuclaw
Copy link
Member

ibuclaw commented Jul 5, 2014

My first thoughts are, why the extern(D) hack? Why not just add an extern(C) interface?

@MartinNowak
Copy link
Member Author

My first thoughts are, why the extern(D) hack? Why not just add an extern(C) interface?

Because extern(D) allows "typesafe" interfaces, i.e. when declaration and definition are not in sync your program will not link.
Also some people like to restrict extern(C) to real C, abusing extern(C) as simple mangling for D function gets in the way of that (see Issue 12959, Issue 7854), not to mention the different calling convention.

- Use extern(D) bindings for the core.thread<->rt.tlsgc
  interface to avoid importing a rt module in core.
@dnadlinger
Copy link
Member

+1, both for eliminating the .di file and using extern(D). I was actually working on something a few hours back, but also ran into the bugs Martin reported and didn't have the patience to work around them.

I spent the last couple of days staring at the core.thread source code and if I learnt one thing, it's that reading the source right now isn't enjoyable at all. After this is in, I'll post a second refactoring pull request to fix the nondescript internal names (slock/m_lock/…), misleading prefixes and a couple of outdated comments.

@dnadlinger
Copy link
Member

Any objections to merging this?

@ibuclaw
Copy link
Member

ibuclaw commented Jul 6, 2014

Not from me.

@alexrp
Copy link
Member

alexrp commented Jul 6, 2014

LGTM, great progress towards sanity.

We may want to use extern (D) for the GC functions too, later down the road. The fact that those are extern (C) has bitten me in the rear on multiple occasions where I was unwittingly overwriting them, causing all sorts of fun crashes.

@dnadlinger
Copy link
Member

Auto-merge toggled on

dnadlinger added a commit that referenced this pull request Jul 6, 2014
@dnadlinger dnadlinger merged commit e4dc49e into dlang:master Jul 6, 2014
9rnsr pushed a commit to 9rnsr/druntime that referenced this pull request Jul 7, 2014
@MartinNowak MartinNowak deleted the tlsgc_externD branch July 8, 2014 09:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants