Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OS thread scheduling is variable and non-determinisitic. Defensive code to check that startup_state isn't STARTUP_COMPLETE before waiting for sdl_intialized_cond. - main() executes the deferred startup, but the simulator thread hasn't been scheduled and isn't (yet) waiting for the sdl_initialized_cond condition to signal. - STARTUP_COMPLETE is a reasonable indicator to the simulator thread that waiting for sdl_intialized_cond is not useful. Bracket the entirety of the function with sdl_initialized_mutex.
- Loading branch information