When to use thread.join()

My apologies if this has been covered. I am new to boost and have been working with the boost thread class. I assume that the join() function waits for the thread to finish execution. But what if the thread has already finished executing? Can I still call join() and have it not wait for infinity? Simon

Simon Reye wrote:
My apologies if this has been covered. I am new to boost and have been working with the boost thread class. I assume that the join() function waits for the thread to finish execution. But what if the thread has already finished executing? Can I still call join() and have it not wait for infinity?
As far as I know if the thread is already finished (the thread's main function has exited) join() will return right away. -delfin

As far as I know if the thread is already finished (the thread's main function has exited) join() will return right away.
-delfin
I did some further tests and this is indeed the case (as you would expect). My particular problem is due to DLL unloading (aaarrrggggghhhh!) Simon
participants (2)
-
Delfin Rojas
-
Simon Reye