Waiting for all threads to finish current message processing
Fixes Invalid attempt made to decrement the event's count below zero.