Skip to content

Commit

Permalink
GameLoop.Exit: Don't call Thread.Join on ourselves
Browse files Browse the repository at this point in the history
  • Loading branch information
bm01 committed Aug 4, 2024
1 parent 128927b commit cf92e80
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions GameServer/managers/GameLoopManager/GameLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ public static void Exit()
if (_gameLoopThread == null)
return;

_gameLoopThread.Interrupt();
_gameLoopThread.Join();
if (Thread.CurrentThread != _gameLoopThread)
{
_gameLoopThread.Interrupt();
_gameLoopThread.Join();
}

_gameLoopThread = null;
_busyWaitThresholdThread.Interrupt();
_busyWaitThresholdThread.Join();
Expand Down

0 comments on commit cf92e80

Please sign in to comment.