Add sleep to posix library startup to avoid race. Closes #857

* On win32 we can get the target control port instantly and immediately connect
  before program startup, on posix systems we must wait until afterwards and
  poll for open sockets.
* This means there's a small window of opportunity where the program may have
  started running but we haven't connected yet to send any initial commands.
  Adding a sleep should give target control time to connect.
This commit is contained in:
baldurk
2018-08-03 16:52:13 +01:00
parent 104072debe
commit 9f7304c780
+4
View File
@@ -69,6 +69,10 @@ void library_loaded()
RDCLOG("Loading into %s", curfile.c_str());
LibraryHooks::RegisterHooks();
// we have a short sleep here to allow target control to connect, since unlike windows we can't
// suspend the process during startup.
Threading::Sleep(15);
}
}