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

◆ LazyInitializeEvent()

void System.Threading.ManualResetEventSlim.LazyInitializeEvent ( )
inlineprivateinherited

Definition at line 108 of file ManualResetEventSlim.cs.

109 {
110 bool isSet = IsSet;
111 ManualResetEvent manualResetEvent = new ManualResetEvent(isSet);
112 if (Interlocked.CompareExchange(ref m_eventObj, manualResetEvent, null) != null)
113 {
114 manualResetEvent.Dispose();
115 return;
116 }
117 bool isSet2 = IsSet;
118 if (isSet2 == isSet)
119 {
120 return;
121 }
122 lock (manualResetEvent)
123 {
124 if (m_eventObj == manualResetEvent)
125 {
126 manualResetEvent.Set();
127 }
128 }
129 }

References System.Threading.Interlocked.CompareExchange(), System.Threading.WaitHandle.Dispose(), System.Threading.ManualResetEventSlim.IsSet, System.Threading.ManualResetEventSlim.m_eventObj, and System.Threading.EventWaitHandle.Set().