Add ValueTask.AsUniTask only for .NET Core

master
neuecc 2020-05-24 01:30:52 +09:00
parent da7e9fc4b3
commit 6dfb969015
1 changed files with 11 additions and 0 deletions

View File

@ -15,5 +15,16 @@ namespace Cysharp.Threading.Tasks
{
return task;
}
public static UniTask<T> AsUniTask<T>(this ValueTask<T> task, bool useCurrentSynchronizationContext = true)
{
// NOTE: get _obj and _token directly for low overhead conversion but not yet implemented.
return task.AsTask().AsUniTask(useCurrentSynchronizationContext);
}
public static UniTask AsUniTask(this ValueTask task, bool useCurrentSynchronizationContext = true)
{
return task.AsTask().AsUniTask(useCurrentSynchronizationContext);
}
}
}