private static void ConcurrentSequencingWorker(ILockUC Lock, ISequencerUC sequencer) { sequencer.Point(SeqPointTypeUC.Match, ConcurrentTryEnterDelaySequencingPhase.Begin); sequencer.Point(SeqPointTypeUC.Notify, ConcurrentTryEnterDelaySequencingPhase.EnteringSimpleLock, Interlocked.Increment(ref StepConcurrentSequencing)); using (EntryBlockUC entry = Lock.TryEnter(150)) { sequencer.PointArg(SeqPointTypeUC.Match, ConcurrentTryEnterDelaySequencingPhase.Entry, entry.HasEntry); if (entry.HasEntry) { sequencer.Point(SeqPointTypeUC.Match, ConcurrentTryEnterDelaySequencingPhase.Locked, Interlocked.Decrement(ref StepConcurrentSequencing)); sequencer.Point(SeqPointTypeUC.Notify, ConcurrentTryEnterDelaySequencingPhase.LockedNotify, Interlocked.Add(ref StepConcurrentSequencing, 0)); } } sequencer.Point(SeqPointTypeUC.Match, ConcurrentTryEnterDelaySequencingPhase.End); }