How do you query a pthread to see if it is still running?
It sounds like you have two questions here: How can I wait until my thread completes? Answer: This is directly supported by pthreads — make your thread-to-be-stopped JOINABLE (when it is first started), and use pthread_join() to block your current thread until the thread-to-be-stopped is no longer running. How can I tell if my thread … Read more