Specifically on line 280, the LiveTracks collection keeps getting modified, as expected, but this leads to some shenanigans as the Database itself is trying to accomplish other tasks on that collection.
I presume this also happens on the other two collections, which means my Lock() calls aren't useful or sane.
What likely needs to happen is a whole refactoring of how the TrackDatabase does things - set up a queue for change processing and only make those changes at specific times to avoid modifying the collections EXCEPT when absolutely required.
Specifically on line 280, the LiveTracks collection keeps getting modified, as expected, but this leads to some shenanigans as the Database itself is trying to accomplish other tasks on that collection. I presume this also happens on the other two collections, which means my Lock() calls aren't useful or sane.
What likely needs to happen is a whole refactoring of how the TrackDatabase does things - set up a queue for change processing and only make those changes at specific times to avoid modifying the collections EXCEPT when absolutely required.