Is there a way to do that? I can only see the method to add a function to the queue. But I can not see a function to wait for when all threads are done working.
In my scenario, it will be that the main application sends a number of tasks to the queue and in the meantime processes and prepares new tasks to be put into the list. However, if all tasks are processed and handed to the queue, how do I wait for all tasks to be done?
Is there a way to do that? I can only see the method to add a function to the queue. But I can not see a function to wait for when all threads are done working.
In my scenario, it will be that the main application sends a number of tasks to the queue and in the meantime processes and prepares new tasks to be put into the list. However, if all tasks are processed and handed to the queue, how do I wait for all tasks to be done?