/// <summary> /// Add an action to be run in the sequence and ensure the sequence is running. /// </summary> public void AddRun(Action action) { _queue.Enqueue(new ActionSet(action)); if (Interlocked.CompareExchange(ref _running, 1, 0) == 0) { Needle.AddSingle(Next); } }
/// <summary> /// Run a single set of arguments. /// </summary> public void Run() { // is there another set of arguments? if (_argsSet.Dequeue()) { // run the action Needle.AddSingle(Action); } }
/// <summary> /// Run a single set of arguments. /// </summary> public void Run() { Needle.AddSingle(_action); }