engine(masterserver): Add sequence for requesting server info, implement StopRefresh and use it on timeout

This commit is contained in:
nillerusr
2023-02-10 22:45:36 +03:00
parent a08b6ae7bf
commit 12716fd07f
6 changed files with 171 additions and 67 deletions
+15 -5
View File
@@ -214,11 +214,7 @@ public:
//-----------------------------------------------------
virtual int YieldWait( CThreadEvent **pEvents, int nEvents, bool bWaitAll = true, unsigned timeout = TT_INFINITE );
virtual int YieldWait( CJob **, int nJobs, bool bWaitAll = true, unsigned timeout = TT_INFINITE );
inline void Yield( unsigned timeout )
{
Assert( ThreadInMainThread() );
ThreadSleep( timeout );
}
void Yield( unsigned timeout );
//-----------------------------------------------------
// Add a native job to the queue (master thread)
@@ -660,6 +656,20 @@ int CThreadPool::YieldWait( CJob **ppJobs, int nJobs, bool bWaitAll, unsigned ti
return YieldWait( handles.Base(), handles.Count(), bWaitAll, timeout);
}
//---------------------------------------------------------
void CThreadPool::Yield( unsigned timeout )
{
// @MULTICORE (toml 10/24/2006): not implemented
Assert( ThreadInMainThread() );
if ( !ThreadInMainThread() )
{
ThreadSleep( timeout );
return;
}
ThreadSleep( timeout );
}
//---------------------------------------------------------
// Add a job to the queue
//---------------------------------------------------------