Boost Users :
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2005-01-04 12:59:06
Martin Pasdzierny wrote:
> Do You mean
> boost::thread::thread() == *th
No. I mean comparing the pointers.
Of course I know, that there is no boost equivalent of pthread_self
of the box.
However you can easily work around this even without modifying
you need it.
During startup of the thread you would manage to store a copy of the
a tss variable. If you want to know how this works I can post you an
This pointer, say "this_thread" can then be used exactly like
pthread_self can be used
(with equivalent sematics).
> with th pointing to a boost::thread is *always* a semantically
> meaningful expression including the case th pointing to the current
> thread (but th != &boost::thread::thread()) ?
Of course your last statement is also true. But since boost::thread is
not copyable (which is a good thing)
it cannot be used easily to identify a thread.
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