Add thread safety

This commit is contained in:
Dean Herbert 2017-12-25 18:22:58 +09:00
parent 6f5f4f76e5
commit 96e4518e60

View File

@ -16,6 +16,7 @@ using osu.Game.Screens;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using OpenTK; using OpenTK;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Platform; using osu.Framework.Platform;
@ -306,9 +307,9 @@ namespace osu.Game
}); });
} }
recentErrorCount++; Interlocked.Increment(ref recentErrorCount);
Scheduler.AddDelayed(() => recentErrorCount--, debounce); Scheduler.AddDelayed(() => Interlocked.Decrement(ref recentErrorCount), debounce);
}; };
} }