Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MThreads startup by making the thread list dynamically init
It seems that a static thread definition (such as logThread in logging.cpp amongst others) can end up using the MThread ctor before the statics for the s_all_threads_lock and s_all_threads are initialized, causing a crash on startup in some situations. To get around this, I've changed them to be null initialized pointers (so they are initialized statically and earlier), and initialize them on first MThread ctor call as necessary. There may be a more graceful fix, but this works. In MThread::Cleanup(), a small restructure was needed such that the lock on s_all_threads_lock can be unlocked before we delete it.
- Loading branch information
Showing
1 changed file
with
60 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters