D2 std.thread and ThreadAddr

Sean Kelly sean at invisibleduck.org
Thu Apr 29 16:40:47 PDT 2010


fawcett at uwindsor.ca Wrote:

> Hi folks,
> 
> I'm crossposting this question from digitalmars.D.learn. Looking at
> D2's documentation on the std.thread module,
> 
> http://www.digitalmars.com/d/2.0/phobos/std_thread.html
> 
> ...there are several functions take a ThreadAddr value as an argument.
> But there are no documented functions, methods or properties one can use
> to obtain a ThreadAddr value.
> 
> I assume this is a documentation error. How do you get a ThreadAddr?

I've always tried to keep the thread module completely platform agnostic so I'm not sure if these routines really should be public at all, but that aside, a ThreadAddr is a platform-dependent type.  It's a pthread_t on Posix and a uint on Windows.  You'd get the address using pthread_self() on Posix and whatever the equivalent is on Windows.



More information about the Digitalmars-d mailing list