K2Informatics.Erlnet.GenericQueue.tryGet C# (CSharp) Méthode

tryGet() public méthode

public tryGet ( ) : Object
Résultat Object
        public Object tryGet()
        {
            Object o = null;

            Monitor.Enter(this);
            try
            {
                if (head != null)
                {
                    o = head.getContents();
                    head = head.getNext();
                    count--;

                    if (head == null)
                    {
                        tail = null;
                        count = 0;
                    }
                }
            }
            finally
            {
                Monitor.Exit(this);
            }

            return o;
        }