block off shared readers to worker threads.

The file system should be thread safe now.
This commit is contained in:
Christoph Oelckers 2023-12-13 22:47:24 +01:00
commit 799679bf6c
3 changed files with 19 additions and 1 deletions

View file

@ -245,6 +245,8 @@ bool FileSystem::InitMultipleFiles (std::vector<std::string>& filenames, LumpFil
{
int numfiles;
// the first call here will designate a main thread which may use shared file readers. All other thewads have to open new file handles.
SetMainThread();
// open all the files, load headers, and count lumps
DeleteAll();
numfiles = 0;