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

◆ TryReset()

bool System.Threading.CancellationTokenSource.TryReset ( )
inlineinherited

Definition at line 419 of file CancellationTokenSource.cs.

420 {
422 if (_state == 0)
423 {
424 bool flag = false;
425 try
426 {
427 TimerQueueTimer timer = _timer;
428 flag = timer == null || (timer.Change(uint.MaxValue, uint.MaxValue) && !timer._everQueued);
429 }
430 catch (ObjectDisposedException)
431 {
432 }
433 if (flag)
434 {
435 Volatile.Read(ref _registrations)?.UnregisterAll();
436 return true;
437 }
438 }
439 return false;
440 }

References System.Threading.CancellationTokenSource._registrations, System.Threading.CancellationTokenSource._state, System.Threading.CancellationTokenSource._timer, System.Threading.Volatile.Read(), and System.Threading.CancellationTokenSource.ThrowIfDisposed().