I have the following situation:
In my C code under Linux I start a number threads in sequence with phtread_create(). Once this is done I invoke pthread_join() in a loop for all of the threads above, in the order in which they were created. Since I don't know when a given thread is going to terminate and join, it might be the case that my code is blocked waiting for the first thread to join, while some of the other threads that were created later have already terminated and are waiting to join.
What I am looking for is something that behaves like pthread_join(), but with the peculiarity that it would stop blocking whenever ANY of the threads created above terminates. Is this at all possible?