From efb89707c624994d7c09305ecaa17c161ccf1e63 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Fri, 3 Feb 2006 10:50:34 +0000 Subject: [PATCH] Don't unlock and then immediately lock again. --- stepmania/src/RageUtil_FileDB.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 71ad87f737..85f5c9e544 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -487,14 +487,11 @@ void FilenameDB::DelFile( const RString &sPath ) void FilenameDB::FlushDirCache() { - while(1) + m_Mutex.Lock(); + while( true ) { - m_Mutex.Lock(); if( dirs.empty() ) - { - m_Mutex.Unlock(); break; - } /* Grab the first entry. Take it out of the list while we hold the * lock, to guarantee that we own it. */ @@ -506,11 +503,9 @@ void FilenameDB::FlushDirCache() * filled, so wait. */ while( !pFileSet->m_bFilled ) m_Mutex.Wait(); - - m_Mutex.Unlock(); - delete pFileSet; } + m_Mutex.Unlock(); } const File *FilenameDB::GetFile( const RString &sPath )