Create our worker thread

This commit is contained in:
Anaïs Betts 2022-01-09 19:46:21 +01:00
parent 8ccc912572
commit e455705c8d
2 changed files with 12 additions and 4 deletions

View File

@ -222,7 +222,7 @@ public:
};
ProducerConsumerQueue<RpcCommand> pendingRpcCommands;
nall::thread* rpcHandlerThread;
nall::thread rpcHandlerThread;
bool fastForwarding = false;
bool rewinding = false;

View File

@ -1,11 +1,19 @@
auto Program::startRpcListener() -> void {
#include <debugapi.h>
auto Program::startRpcListener() -> void {
// NB: There is no cross-platform way to read from a pipe in a non-blocking
// way. So instead, we're going to spin up a blocking thread that reads stdin
// and processes it. What's even worse, is that we can't even properly
// terminate this thread since there's no timeout on blocking stdin reads,
// all we can do is force-terminate this thread on exit.
rpcHandlerThread = nall::thread::create([&](auto param) {
OutputDebugStringA("HELLO IT WORKED LOOK AT THIS\n");
});
}
auto Program::stopRpcListener() -> void {
rpcHandlerThread.cancel();
}
auto Program::processRpcCommands() -> void {
}