From 79330d7cdbb4edad8a0112599e6ff826a47dd1f9 Mon Sep 17 00:00:00 2001 From: neuecc Date: Mon, 8 Jun 2020 01:50:20 +0900 Subject: [PATCH] ReadMe --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 79715eb..9933bb1 100644 --- a/README.md +++ b/README.md @@ -741,6 +741,16 @@ public class ZeroAllocAsyncAwaitInDotNetCore } } } + +// UniTask does not return to original SynchronizationContext but you can use helper `ReturnToCurrentSynchronizationContext`. +public ValueTask TestAsync() +{ + await using (UniTask.ReturnToCurrentSynchronizationContext()) + { + await UniTask.SwitchToThreadPool(); + // do anything.. + } +} ``` .NET Core version is intended to allow users to use UniTask as an interface when sharing code with Unity (such as [Cysharp/MagicOnion](https://github.com/Cysharp/MagicOnion/)). .NET Core version of UniTask enables smooth code sharing.