Skip to content

Commit 3da9f79

Browse files
committed
perf(init): stop using a mutex during search paths
* I don't think there's any IO threading here that would warrant the need for mutexing this, as all platforms now use a single IO thread * this greatly improves initialization time when scanning paths
1 parent 6cb9661 commit 3da9f79

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/filesystem/basefilesystem.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,8 @@ abstract_class CBaseFileSystem : public CTier1AppSystem< IFileSystem >
580580

581581
if ( *ppszFilename && !Q_IsAbsolutePath( *ppszFilename ) )
582582
{
583-
// Copy paths to minimize mutex lock time
584-
pFileSystem->m_SearchPathsMutex.Lock();
583+
// Copy to keep filesystem intact
585584
CopySearchPaths( pFileSystem->m_SearchPaths );
586-
pFileSystem->m_SearchPathsMutex.Unlock();
587585

588586
pFileSystem->FixUpPath ( *ppszFilename, m_Filename, sizeof( m_Filename ) );
589587
}
@@ -611,10 +609,8 @@ abstract_class CBaseFileSystem : public CTier1AppSystem< IFileSystem >
611609
{
612610
m_pathID = UTL_INVAL_SYMBOL;
613611
}
614-
// Copy paths to minimize mutex lock time
615-
pFileSystem->m_SearchPathsMutex.Lock();
612+
// Copy to keep filesystem intact
616613
CopySearchPaths( pFileSystem->m_SearchPaths );
617-
pFileSystem->m_SearchPathsMutex.Unlock();
618614
m_Filename[0] = '\0';
619615
}
620616

0 commit comments

Comments
 (0)