
6 Nov
2006
6 Nov
'06
4:46 p.m.
Thanks for the quick answers. I understood and experienced that the main thread blocks. But how can it join other threads, if it is blocked? That doesn't seem consistent to me. Torsten
Hi!
join cause a calling thread to block until the second one is finished. This is
also stated in the
docs: 1.void join(); Requires: *this is joinable. !!!!!Effects: The current thread of execution blocks until the initial function of the thread of execution represented by *this finishes and all resources are reclaimed. Notes: If *this == thread() the result is implementation-defined. If the implementation doesn't detect this the result will be deadlock.