Boost logo

Boost Users :

From: olivier_debels olivier_debels_at_[hidden])
Date: 2002-12-16 06:32:39


I'm using boost_1_29_0 and need to get the id of the current thread.

Is there a way to get the id of the current thread using boost? I
don't see how I can access the current thread (Is there some sort of
current function?).

If I could access the current thread, I could write a getId()
function (in a class subclassed from boost::thread). Only problem
there is the return type. It seems the id is an int in windows
environment, a pthread_t in POSIX and a MPTaskID in MACOS. Those
last two seems to be pointers to struct. I guess it is possible to
cast all of them to long (using reinterpret casting), but maybe I am
overlooking something then.

thanks,

Olivier.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net