Pathfinding.ThreadControlQueue.PushFront C# (CSharp) 메소드

PushFront() 공개 메소드

public PushFront ( Path p ) : void
p Path
리턴 void
		public void PushFront (Path p) {
			//If termination is due, why add stuff to a queue which will not be read from anyway
			if (terminate) return;
			
			lock (lockObj) {
				if (tail == null) {// (tail == null) ==> (head == null)
					head = p;
					tail = p;
					
					if (starving && !blocked) {
						starving = false;
						block.Set();
					} else {
						starving = false;
					}
				} else {
					p.next = head;
					head = p;
				}
			}
		}