fix a race-condition in JobSystem

mThreadMap needs to be protected as it's accessed from multiple threads.
This commit is contained in:
Pixelflinger
2020-04-03 16:51:05 -07:00
committed by Mathias Agopian
parent 2ad932f345
commit fb0e89d969
2 changed files with 10 additions and 0 deletions

View File

@@ -403,6 +403,7 @@ private:
uint8_t mParallelSplitCount = 0; // # of split allowable in parallel_for
Job* mMasterJob = nullptr;
utils::SpinLock mThreadMapLock; // this should have very little contention
tsl::robin_map<std::thread::id, ThreadState *> mThreadMap;
};