Pathfinding.ThreadControlQueue.Push C# (CSharp) Method

Push() public method

public Push ( Path p ) : void
p Path
return void
		public void Push (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 {
					tail.next = p;
					tail = p;
				}
			}
		}