clojure.lang.Agent.Enqueue C# (CSharp) Méthode

Enqueue() private méthode

Enqueue an action in the pending queue.
Spin-locks to update the queue.
private Enqueue ( System.Action action ) : void
action System.Action The action to enqueue.
Résultat void
        void Enqueue(Action action)
        {
            bool queued = false;
            IPersistentStack prior = null;
            while (!queued)
            {
                prior = _q.Get();
                queued = _q.CompareAndSet(prior, (IPersistentStack)prior.cons(action));
            }

            if (prior.count() == 0)
                action.execute();
        }