<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 10:19 PM, Bienlein <span dir="ltr"><<a href="mailto:jeti789@web.de" target="_blank">jeti789@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tuesday, 4 March 2014 at 04:39:33 UTC, Timothee Cour wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I couldn't find a wrapper to get current thread id.<br>
There is Thread.getThis but the address it returns is the same for all<br>
threads as explained here (<a href="http://ddili.org/ders/d.en/concurrency.html" target="_blank">http://ddili.org/ders/d.en/<u></u>concurrency.html</a>) so<br>
it's not useful for logging.<br>
<br>
How about adding this:<br>
auto getTid() to class Thread<br>
Implementation on OSX:<br>
mach_port_t tid = pthread_mach_thread_np(<u></u>pthread_self());<br>
</blockquote>
<br></div></div>
The spawn function returns the tid, see the sample here: <a href="http://dlang.org/phobos/std_concurrency.html" target="_blank">http://dlang.org/phobos/std_<u></u>concurrency.html</a><br>
<br>
</blockquote></div><br></div><div class="gmail_extra">that gives tid of spawned thread, not 'self'. </div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>