projects/Extant/Threading/ThreadRun.cs
/// <summary>
/// Main run function for this thread.
/// </summary>
Main run function for this thread.
Main run function for this thread .
private void Run()
        {
            try
            {
                OnBegin();
                long timeUntilNextTick = 0;
                while (!_isStopping)
                {
                    HandleTickCalls(out timeUntilNextTick);
                    if (_isInvokable)
                        HandleInvoked();
                    Thread.Sleep((int)timeUntilNextTick);
                }
            }
            catch (Exception e)
            {
                _unhandledException = e;
                this.Stop();
            }
            OnFinish(_unhandledException);
            _isStopped = true;
        }
private void Run ( ) { try { OnBegin ( ) ; long timeUntilNextTick = 0 ; while ( ! _isStopping ) { HandleTickCalls ( out timeUntilNextTick ) ; if ( _isInvokable ) HandleInvoked ( ) ; Thread . Sleep ( ( int ) timeUntilNextTick ) ; } } catch ( Exception e ) { _unhandledException = e ; this . Stop ( ) ; } OnFinish ( _unhandledException ) ; _isStopped = true ; }
Main run function for this thread.
Main run function for this thread .
//Sleep until the next tick