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

◆ WaitUntilCountOrTimeout()

bool System.Threading.SemaphoreSlim.WaitUntilCountOrTimeout ( int millisecondsTimeout,
uint startTime,
CancellationToken cancellationToken )
inlineprivate

Definition at line 243 of file SemaphoreSlim.cs.

244 {
245 int num = -1;
246 while (m_currentCount == 0)
247 {
248 cancellationToken.ThrowIfCancellationRequested();
249 if (millisecondsTimeout != -1)
250 {
251 num = TimeoutHelper.UpdateTimeOut(startTime, millisecondsTimeout);
252 if (num <= 0)
253 {
254 return false;
255 }
256 }
257 bool flag = Monitor.Wait(m_lockObjAndDisposed, num);
259 {
261 }
262 if (!flag)
263 {
264 return false;
265 }
266 }
267 return true;
268 }
readonly StrongBox< bool > m_lockObjAndDisposed

References System.cancellationToken, System.Threading.SemaphoreSlim.m_countOfWaitersPulsedToWake, System.Threading.SemaphoreSlim.m_currentCount, System.Threading.SemaphoreSlim.m_lockObjAndDisposed, System.millisecondsTimeout, System.Threading.TimeoutHelper.UpdateTimeOut(), and System.Threading.Monitor.Wait().

Referenced by System.Threading.SemaphoreSlim.Wait().