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:
parent
14273824dc
commit
5c9e84caf0
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user