how to wait for a thread until it stopped

Boost-users