getTid wrapper

Stanislav Blinov stanislav.blinov at gmail.com
Tue Mar 4 02:34:59 PST 2014


On Tuesday, 4 March 2014 at 04:39:33 UTC, Timothee Cour wrote:
> I couldn't find a wrapper to get current thread id.
> There is Thread.getThis but the address it returns is the same 
> for all threads

That is not true.

> as explained here (http://ddili.org/ders/d.en/concurrency.html)

Where exactly? I couldn't find it, but if Ali's book states that 
Thread.getThis() returns the same reference, it's a bug in the 
book that should be fixed.

> auto getTid() to class Thread

core.thread.Thread.getThis();
std.concurrency.thisTid;

The latter one is mentioned in that same chapter.


More information about the Digitalmars-d-learn mailing list