I'm trying to figure out how to get rid of the pthread_timedjoin_np dependency, because I'm trying to create some code in OSX.
Right now I have a queue of threads that I exit from doing this pthread_timedjoin_np, and if they do not return, they will be thrown into the queue.
The end of the thread_function called for each thread has pthread_exit (0); so that the receiving stream can check for a zero return value.
I thought that I could try using pthread_cond_timedwait () to achieve a similar effect, however, I think I have no step.
I thought I could make worker thread A a condition signal AND pthread_exit () in the mutex, and worker thread B could wake up after the signal, and then pthread_join (). The problem is that Thread B does not know which thread has dropped the conditional signal. Should I explicitly pass this as part of the conditional signal, or what?
thank
Derek
Derek source
share