void StartBattleHandler() { while (true) { Thread.Sleep(2000); if (userIDsForMatchmaking.userIDsForMatchmaking.Count >= 2) { battleHandlerObj.PrepareBattle(ref fighting, ref userIDsForMatchmaking); } Thread.Sleep(10000); mut.WaitOne(); fighting.fighting = Tuple.Create(0, 0, false, false); mut.ReleaseMutex(); } }