Boost logo

Boost :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-06-30 15:03:46


Philippe A. Bouchard said:
> William E. Kempf wrote:
>
> [...]
>
>> As already pointed out, to associate data with a thread you use
>> thread_specific_ptr. BTW, you still have to remember that the
>> functor is copied, and data passed to/in the functor is not
>> considered part of the thread in any event.
>
> Ok, how do you find out the data of the current thread? The key in
> boost::detail::tss is not the same as the one in boost::thread.

What data? The actual thread data (there's not much, beyond the thread id
which isn't direclty accessible) is found by calling the default c-tor on
the thread. The data passed in the functor is your responsibility.
Either you explicitly pass it everywhere that's needed, or the thread
stores it in a tss key.

-- 
William E. Kempf

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk