Skip to content

Commit 8c1ea71

Browse files
committed
Potential improvement to CBaseGame thread performance.
1 parent 190862e commit 8c1ea71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ghost/game_base.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ void CBaseGame :: loop( )
217217
select( nfds + 1, NULL, &send_fd, NULL, &send_tv );
218218
#endif
219219

220+
if( NumFDs == 0 )
221+
{
222+
// select will return immediately and we'll chew up the CPU if we let it loop so just sleep for 50ms to kill some time
223+
MILLISLEEP( 50 );
224+
}
225+
220226
if( Update( &fd, &send_fd ) )
221227
{
222228
CONSOLE_Print( "[GameThread] deleting game [" + GetGameName( ) + "]" );

0 commit comments

Comments
 (0)