Increase the stream, check if the stream is ready to join

I would like to know if there is a way to test whenever a thread is completed and is waiting to join. My guess was using time_join. is there an explicit way to test it?

+4
source share
2 answers

There is no API for this in boost::thread . I think the reason is that the thread can be detached and made non- joinable . The best defense is probably a wrapper and a flag.

+3
source

timed_join with a duration of 0 can be seen as try_join, so yes, you can check if the stream is complete. I think there is already a function request to add this try_join function to Boost.Thread.

+1
source

Source: https://habr.com/ru/post/1307209/


All Articles