diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
index 379b6c2..a7e0bce 100644
--- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
+++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs
@@ -50,6 +50,50 @@ namespace Cysharp.Threading.Tasks
}
}
+ /// Run action on the threadPool and return to main thread if configureAwait = true.
+ public static async UniTask Run(Func action, bool configureAwait = true)
+ {
+ await UniTask.SwitchToThreadPool();
+
+ if (configureAwait)
+ {
+ try
+ {
+ await action();
+ }
+ finally
+ {
+ await UniTask.Yield();
+ }
+ }
+ else
+ {
+ await action();
+ }
+ }
+
+ /// Run action on the threadPool and return to main thread if configureAwait = true.
+ public static async UniTask Run(Func