Waiting for Detached Thread

How can I make main() thread to wait for a detached thread without using sleep ? Is main thread is kernel level thread ?
Last edited on
Waiting for a detached thread defeats the point: threads are detached if there's no reason to join them.
As a workaround, the main thread could wait on a condition variable that is notified by the detached thread at exit.
thanks Cubbi
... or you could not detatch the thread in the first place.
Topic archived. No new replies allowed.