1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

Add lock object

This commit is contained in:
Dean Herbert 2025-02-05 17:31:54 +09:00
parent 14273824dc
commit 5c9e84caf0
No known key found for this signature in database

View File

@ -226,12 +226,14 @@ namespace osu.Game.Screens.SelectV2
private Task filterTask = Task.CompletedTask;
private CancellationTokenSource cancellationSource = new CancellationTokenSource();
private readonly object cancellationLock = new object();
private async Task performFilter()
{
Stopwatch stopwatch = Stopwatch.StartNew();
var cts = new CancellationTokenSource();
lock (this)
lock (cancellationLock)
{
cancellationSource.Cancel();
cancellationSource = cts;