From fee5518a823489dbd409e00c1f4367a821a7286c Mon Sep 17 00:00:00 2001 From: neuecc Date: Sat, 4 Jul 2020 06:29:50 +0900 Subject: [PATCH] Improve, Select/Where add UniTaskTracker --- .../Assets/Plugins/UniTask/Runtime/Linq/Select.cs | 12 ++++++++++++ .../Assets/Plugins/UniTask/Runtime/Linq/Where.cs | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs index 3a646d2..50e9cec 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs @@ -88,6 +88,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -156,6 +157,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -195,6 +197,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -263,6 +266,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -302,6 +306,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -382,6 +387,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -422,6 +428,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -502,6 +509,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -541,6 +549,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -621,6 +630,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -661,6 +671,7 @@ namespace Cysharp.Threading.Tasks.Linq this.selector = selector; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TResult Current { get; private set; } @@ -741,6 +752,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs index 8e9ec62..1b5ac47 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs @@ -88,6 +88,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -165,6 +166,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -204,6 +206,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -281,6 +284,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -320,6 +324,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -410,6 +415,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -450,6 +456,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -540,6 +547,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -579,6 +587,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -669,6 +678,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } } @@ -709,6 +719,7 @@ namespace Cysharp.Threading.Tasks.Linq this.predicate = predicate; this.cancellationToken = cancellationToken; this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); } public TSource Current { get; private set; } @@ -799,6 +810,7 @@ namespace Cysharp.Threading.Tasks.Linq public UniTask DisposeAsync() { + TaskTracker.RemoveTracking(this); return enumerator.DisposeAsync(); } }