I am working on an application with multiple threads (using Qt, C++). One of this threads is designed to execute a batch of operations like reading/writing from/to files as well as creating new ones. Sometimes, while this worker thread is active, I need some sort of confirmation from the user for operations like overwriting a file; I was thinking about doing this by emitting a signal from the worker and waiting for a response from the UI thread, which will show a popup and then give back the result; but I think this is an anti-pattern for asynchronous programming.
Are there any good, safe patterns to manage a problem like this?