random stuff you might find useful

torhu fake at address.dude
Tue May 22 07:33:02 PDT 2007


Downs wrote:
> Here's a collection of random stuff I made. Feel free to grab sniplets as you see fit.
> 
> module tools.Tools;
> import std.string, std.thread, std.file, std.bind, std.stdio: FILE;
> import std.c.stdio;
> 
> /// get the currently active thread (duh)
> int getThread() { foreach (idx, thr; Thread.getAll) if (thr.isSelf) return idx; assert(false); }
> 
<snip>

 From std.thread docs:

static Thread getThis();
     Returns a reference to the Thread for the thread that called the 
function.

Isn't this what you're doing?



More information about the Digitalmars-d mailing list