
10 Sep
2009
10 Sep
'09
10:35 a.m.
2009/9/10 Agustín K-ballo Bergé <kaballo86@hotmail.com>:
I've found a need to retrieve a thread id rather than a thread handle on Windows. There is no documented way to get it from the handle on XP (see http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/89728ee1-d9d8... ). Would it make sense to add a get_native_id member function?
boost::thread and std::thread don't know what the native thread type is, nor do they know that Windows has two native thread types. The correct solution seems to be: struct native_handle_type { HANDLE handle; DWORD id; // perhaps, for backward compatibilty operator HANDLE() { return handle; } }; In other words it's a QOI detail. Yechezkel Mett