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

◆ LazilyCreateEvent() [3/3]

bool System.Net.LazyAsyncResult.LazilyCreateEvent ( out ManualResetEvent waitHandle)
inlineprivateinherited

Definition at line 119 of file LazyAsyncResult.cs.

120 {
121 waitHandle = new ManualResetEvent(initialState: false);
122 try
123 {
124 if (Interlocked.CompareExchange(ref _event, waitHandle, null) == null)
125 {
127 {
128 waitHandle.Set();
129 }
130 return true;
131 }
132 waitHandle.Dispose();
133 waitHandle = (ManualResetEvent)_event;
134 return false;
135 }
136 catch
137 {
138 _event = null;
139 waitHandle?.Dispose();
140 throw;
141 }
142 }
static int CompareExchange(ref int location1, int value, int comparand)

References System.Net.LazyAsyncResult._event, System.Threading.Interlocked.CompareExchange(), System.Net.LazyAsyncResult.InternalPeekCompleted, and System.Threading.EventWaitHandle.Set().