Update thread-safe implementation for GameFiles
Locking on the value of a private static variable to prevent thread-safety violations and performance issues.
I'll take a look when I'll have time, probably during the next weekend.. Thanks!
OK overall this seems like an harmless change, but could you explain a bit what problem it solves and how is this improving performance? Thanks!
I haven't looked at the full engine yet but so far what I've found and based on what I've experienced, the previous version implemented a non-safe singleton pattern. We may try to multi-thread saving some game files in the future so these changes ensure that. If there isn't a lock, 2 or more threads can jump into a single if statement providing they bypass the check but haven't created an instance. I'm sorry if this is quite trivial.