allow not timing out on semaphore waits
This commit is contained in:
@@ -661,13 +661,13 @@ void RageSemaphore::Post()
|
||||
m_pSema->Post();
|
||||
}
|
||||
|
||||
void RageSemaphore::Wait()
|
||||
void RageSemaphore::Wait( bool bFailOnTimeout )
|
||||
{
|
||||
retry:
|
||||
if( m_pSema->Wait() )
|
||||
return;
|
||||
|
||||
if( Dialog::IsShowingDialog() )
|
||||
if( !bFailOnTimeout || Dialog::IsShowingDialog() )
|
||||
goto retry;
|
||||
|
||||
/* We waited too long. We're probably deadlocked, though unlike mutexes, we can't
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
CString GetName() const { return m_sName; }
|
||||
int GetValue() const;
|
||||
void Post();
|
||||
void Wait();
|
||||
void Wait( bool bFailOnTimeout=true );
|
||||
bool TryWait();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user