Skip to content

Commit

Permalink
Potential improvement to CBaseGame thread performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
perennate committed Aug 8, 2012
1 parent 190862e commit 8c1ea71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ghost/game_base.cpp
Expand Up @@ -217,6 +217,12 @@ void CBaseGame :: loop( )
select( nfds + 1, NULL, &send_fd, NULL, &send_tv );
#endif

if( NumFDs == 0 )
{
// 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
MILLISLEEP( 50 );
}

if( Update( &fd, &send_fd ) )
{
CONSOLE_Print( "[GameThread] deleting game [" + GetGameName( ) + "]" );
Expand Down

0 comments on commit 8c1ea71

Please sign in to comment.