replace gotos with do/while logic where appropriate

This commit is contained in:
Devin J. Pohly
2013-01-25 17:56:33 -05:00
parent 001ee51242
commit 9237741149
3 changed files with 63 additions and 65 deletions
+5 -6
View File
@@ -751,12 +751,11 @@ void RageSemaphore::Post()
void RageSemaphore::Wait( bool bFailOnTimeout )
{
retry:
if( m_pSema->Wait() )
return;
if( !bFailOnTimeout || RageThread::GetIsShowingDialog() )
goto retry;
do
{
if( m_pSema->Wait() )
return;
} while( !bFailOnTimeout || RageThread::GetIsShowingDialog() );
/* We waited too long. We're probably deadlocked, though unlike mutexes, we can't
* tell which thread we're stuck on. */