I use a thread pool and and I submit some tasks to be proccessed.
Sometimes a server that I ping or my internet connection could be down. This can be determined by any of the running threads.
In that case I would like the thread that detected the error to notify the others to pause their execution until the error is fixed.
Do you know how is this possible?
I add to the above. The ideal solution would be : when a threads detects the program to send a message to all other threads to wait. Also it should notify an external server and after receiving that everything is ok from the server to send again a signal to the other threads to continue the work.