diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 3b1b7ce161..5dd9bdf9a2 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -531,6 +531,16 @@ void FilenameDB::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDi } } +/* Get a complete copy of a FileSet. This isn't very efficient, since it's a deep + * copy, but allows retrieving a copy from elsewhere without having to worry about + * our locking semantics. */ +void FilenameDB::GetFileSetCopy( CString sDir, FileSet &out ) +{ + FileSet *pFileSet = GetFileSet( sDir ); + out = *pFileSet; + m_Mutex.Unlock(); /* locked by GetFileSet */ +} + /* * Copyright (c) 2003-2004 Glenn Maynard * All rights reserved. diff --git a/stepmania/src/RageUtil_FileDB.h b/stepmania/src/RageUtil_FileDB.h index 3e52b90389..42c53df486 100644 --- a/stepmania/src/RageUtil_FileDB.h +++ b/stepmania/src/RageUtil_FileDB.h @@ -123,6 +123,8 @@ public: void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ); void FlushDirCache(); + + void GetFileSetCopy( CString dir, FileSet &out ); }; /* This FilenameDB must be populated in advance. */