Boost logo

Boost Users :

From: Yang Zhang (yanghatespam_at_[hidden])
Date: 2008-04-10 11:33:04


Anthony Williams wrote:
> Yang Zhang <yanghatespam_at_[hidden]> writes:
>
>> Johan Råde wrote:
>>> Yang Zhang wrote:
>>>> Hi, I like using boost threads, but I'm currently working on a project
>>>> where I need to access the private handle to the underlying system
>>>> thread (in the cases I'm concerned about, the pthread_t). This is so
>>>> that I can take advantage of platform-specific functionality, such as
>>>> setting CPU affinity and (more generally) calling into other libraries
>>>> that expect a pthread_t. Is there any way to do get this handle?
>>>>
>>>> Thanks!
>>>>
>>> class thread
>>> {
>>> public:
>>> ...
>>> typedef platform-specific-type native_handle_type;
>>> native_handle_type native_handle();
>>> ...
>>> };
>> Hmm. Looking at the source, this doesn't actually seem to be in
>> there...at least not in the latest release (1.35).
>
> It's there for Win32 and not for pthreads. I'll add it for pthreads on trunk.
>
> Anthony

I see.

While you're at it, would you mind also adding it uniformly to all the
other threading primitives (mutex, etc.)?

Thanks!

-- 
Yang Zhang
http://www.mit.edu/~y_z/

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