I’m not working on Window’s first off. I tried the techniques described here: to no avail.
Basically, I’m building a webcrawler that needs to suspend the main thread right before it outputs the results. The main thread needs to resume when my last pthread dies. I know the point when my last pthread dies, I just don’t know how to suspend or resume the main thread.
Any help is greatly appreciated!
EDIT:
So, probably only one worker thread will exist at the point I want to suspend/resume main. I’m doing it in the constructor, and threads spawn as I gather more links.
In the main thread, call
pthread_join()on each of the worker threads.