K2Informatics.Erlnet.GenericQueue.tryGet C# (CSharp) 메소드

tryGet() 공개 메소드

public tryGet ( ) : Object
리턴 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;
        }