Пример #1
0
        private void Execute(object state)
        {
            _status = _THREADING.TaskStatus.Running;

            try
            {
                _action();
            }
            catch
            {
                _status = _THREADING.TaskStatus.Faulted;
            }

            _status = _THREADING.TaskStatus.RanToCompletion;

            _completed.Set();
        }
Пример #2
0
 protected TaskWrapper()
 {
     _id        = Interlocked.Increment(ref _unique_id);
     _status    = _THREADING.TaskStatus.Created;
     _completed = new ManualResetEvent(false);
 }
Пример #3
0
 protected void SetStatus(_THREADING.TaskStatus status)
 {
     _status = status;
 }