CPU simulation in another thread

This commit is contained in:
Valentin Haudiquet 2023-10-08 17:07:24 +02:00
parent f2c573bfc6
commit a10f56446a

View File

@ -27,8 +27,12 @@ int main(int argc, char** argv)
gdbstub_wait_for_connection(); gdbstub_wait_for_connection();
} }
// CPU simulation // CPU simulation : create cpu0 thread
cpu_loop(cpu0); pthread_t cpu0_thread;
pthread_create(&cpu0_thread, 0, (void*) cpu_loop, cpu0);
// Wait for the simulation to end
pthread_join(cpu0_thread, 0);
return 0; return 0;
} }