I need a way to know if the thread I am running is finished or not. If it is not finished it wait and if it is finished print a successful message.
I don't find a method or something like that in c++11 from library thread.
I can't set a global variable because inside thread I am using execvp
and it does not return if successful.
Is there any way to do that? A method or flag or anything else.
Edit:
To make it clear I want to write a function that checks if thread is finished.