implement thread pool wait and pause and resume functions
The thread pool is missing wait pause and resume functions which can be used in certain situations to optimize, fix or write better code and unittests.
-
the pause function should block all threads on a condition variable and should block the current thread until that happens. it is a lightweight implementation of stop function which destroys the threads (should not be called on processing threads)
-
the resume function should signal waiting threads to resume processing and it is a lightweight implementation of the start function which creates new threads
-
the wait function blocks the calling thread until all items in the queue are processe. This function is useful for unittests as it forces all packets to be processed (used in #991 (closed)). It can also be used when switching from MT to ST when currently queued packets are dropped, but the main thread should wait for all packets to be handled and then switch to ST.