Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AsyncVoidMethodBuilder.cs
Go to the documentation of this file.
4
6
8{
10
12
13 private Task Task => _builder.Task;
14
16
18 {
20 current?.OperationStarted();
22 result._synchronizationContext = current;
23 return result;
24 }
25
26 [MethodImpl(MethodImplOptions.AggressiveInlining)]
27 [DebuggerStepThrough]
28 public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
29 {
31 }
32
37
38 public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
39 {
40 _builder.AwaitOnCompleted(ref awaiter, ref stateMachine);
41 }
42
43 public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
44 {
45 _builder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
46 }
47
48 public void SetResult()
49 {
50 if (TplEventSource.Log.IsEnabled())
51 {
52 TplEventSource.Log.TraceOperationEnd(Task.Id, AsyncCausalityStatus.Completed);
53 }
55 if (_synchronizationContext != null)
56 {
58 }
59 }
60
62 {
63 if (exception == null)
64 {
66 }
67 if (TplEventSource.Log.IsEnabled())
68 {
69 TplEventSource.Log.TraceOperationEnd(Task.Id, AsyncCausalityStatus.Error);
70 }
71 if (_synchronizationContext != null)
72 {
73 try
74 {
76 }
77 finally
78 {
80 }
81 }
82 else
83 {
85 }
87 }
88
100}
static ? SynchronizationContext Current
static void ThrowAsync(Exception exception, SynchronizationContext targetContext)
Definition Task.cs:1806
static readonly TplEventSource Log
static void ThrowArgumentNullException(string name)
void Start< TStateMachine >(ref TStateMachine stateMachine)
void AwaitOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)
void AwaitUnsafeOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)