diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
index 173b355..ac3e795 100644
--- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
+++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
@@ -9,237 +9,56 @@ namespace Cysharp.Threading.Tasks
{
#region OBSOLETE_RUN
- // Run is a confusing name, use only RunOnThreadPool in the future.
-
- /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
- public static async UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = default)
+ [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
+ public static UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = default)
{
- cancellationToken.ThrowIfCancellationRequested();
-
- await UniTask.SwitchToThreadPool();
-
- cancellationToken.ThrowIfCancellationRequested();
-
- if (configureAwait)
- {
- try
- {
- action();
- }
- finally
- {
- await UniTask.Yield();
- }
- }
- else
- {
- action();
- }
-
- cancellationToken.ThrowIfCancellationRequested();
+ return RunOnThreadPool(action, configureAwait, cancellationToken);
}
- /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
- public static async UniTask Run(Action