Thanks for the fast response.
However, if I try to join threads in the destructor of the class derived from AudioProcessor, it fails (timeout right at the ->join command). An explanation could be that the threads have already been shut down when the DLL has begun unloading.
The problem seems to be known:
"Consider a DLL that creates worker threads as part of its initialization. Upon DLL cleanup, it is necessary to synchronize with all the worker threads to ensure that the data structures are in a consistent state and then terminate the worker threads. Today, there is no straightforward way to completely solve the problem of cleanly synchronizing and shutting down DLLs in a multithreaded environment. This section describes the current best practices for thread synchronizing during DLL shutdown"