Browse Source
Merge pull request #11240 from AvaloniaUI/feature/add-getawaiter-t
Add GetAwaiter<T> for DispatcherOperation<T>
pull/11247/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
src/Avalonia.Base/Threading/DispatcherOperation.cs
|
|
|
@ -331,6 +331,8 @@ public class DispatcherOperation<T> : DispatcherOperation |
|
|
|
|
|
|
|
private TaskCompletionSource<T> TaskCompletionSource => (TaskCompletionSource<T>)TaskSource!; |
|
|
|
|
|
|
|
public new TaskAwaiter<T> GetAwaiter() => GetTask().GetAwaiter(); |
|
|
|
|
|
|
|
public new Task<T> GetTask() => TaskCompletionSource!.Task; |
|
|
|
|
|
|
|
protected override Task GetTaskCore() => GetTask(); |
|
|
|
|