Handle incoming events from off-threads separately

On the Wine side we want to handle most events on the main UI thread.
We'll assume any events coming in from a secondary socket are safe and
can be handled directly.
This commit is contained in:
Robbert van der Helm
2020-10-26 13:45:19 +01:00
parent 81efa6febe
commit 8d7826f1df
4 changed files with 57 additions and 33 deletions
+6
View File
@@ -95,6 +95,12 @@ EventHandler::EventHandler(
void EventHandler::connect() {
if (acceptor) {
acceptor->accept(socket);
// As mentioned in `acceptor's` docstring, this acceptor will be
// recreated in `receive()` on another context, and potentially on the
// other side of the connection in the case of `vst_host_callback`
acceptor.reset();
fs::remove(endpoint.path());
} else {
socket.connect(endpoint);
}