3

I'm using the APR thread pool (for portability) and I'm trying to get the threads exit codes, because I want to close the whole program (When there are specific error codes).

I noticed that there's no APR function that can access the threads individually from the pool, and there's no APR functions that "joins" the threads in the pool.

The question is, how can I wait on the thread pool and get the threads exit codes when at-least one of them is finished (Using the APR library)

Drxxd
  • 1,860
  • 14
  • 34
  • Hmm, no, the point of a thread pool is that the threads do not exit. They get re-used. So of course there is no exit code to look at. You'll have to re-think this. – Hans Passant Mar 09 '17 at 13:50
  • But what happens if one of the threads fail, how can I know that it failed (except for signalling an event to the whole program)? because checking the actual exit codes seems to be much more cleaner – Drxxd Mar 09 '17 at 13:58

0 Answers0