Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Complete() [2/2]

override void System.Net.ContextAwareResult.Complete ( IntPtr userToken)
inlineprotectedvirtual

Reimplemented from System.Net.LazyAsyncResult.

Definition at line 145 of file ContextAwareResult.cs.

146 {
147 if (System.Net.NetEventSource.Log.IsEnabled())
148 {
149 System.Net.NetEventSource.Info(this, $"_context(set):{_context != null} userToken:{userToken}", "Complete");
150 }
151 if ((_flags & StateFlags.PostBlockStarted) == 0)
152 {
153 base.Complete(userToken);
154 }
155 else
156 {
157 if (base.CompletedSynchronously)
158 {
159 return;
160 }
161 ExecutionContext context = _context;
162 if (userToken != IntPtr.Zero || context == null)
163 {
164 base.Complete(userToken);
165 return;
166 }
167 ExecutionContext.Run(context, delegate(object s)
168 {
169 ((ContextAwareResult)s).CompleteCallback();
170 }, this);
171 }
172 }
ContextAwareResult(bool captureIdentity, bool forceCaptureContext, object myObject, object myState, AsyncCallback myCallBack)
volatile ExecutionContext _context
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Run(ExecutionContext executionContext, ContextCallback callback, object? state)

References System.Net.ContextAwareResult.ContextAwareResult(), System.Net.ContextAwareResult._context, System.Net.ContextAwareResult._flags, System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.Threading.ExecutionContext.Run(), System.s, and System.IntPtr.Zero.