Transfers a node from a condition queue onto sync queue.
Returns true if successful.
@param node the node
@return true if successfully transferred (else the node was
cancelled before signal)
488737
final boolean transferForSignal(Node node) {
        /*
         * If cannot change waitStatus, the node has been cancelled.
         */
        if (!node.compareAndSetWaitStatus(Node.CONDITION, 0))
            return false;

        /*
         * Splice onto queue and try to set waitStatus of predecessor to
         * indicate that thread is (probably) waiting. If cancelled or
         * attempt to set waitStatus fails, wake up to resync (in which
         * case the waitStatus can be transiently and harmlessly wrong).
         */
        Node p = enq(node);
        int ws = p.waitStatus;
        if (ws > 0 || !p.compareAndSetWaitStatus(ws, Node.SIGNAL))
            LockSupport.unpark(node.thread);
        return true;
    }
102906
public boolean hasEnoughMemory(ClusterNode node) {
    int total = node.getTotal().memoryMB;
    int free = node.getFree().memoryMB;
    if (free < nodeReservedMemoryMB) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(node.getHost() + " not enough memory." +
          " totalMB:" + total +
          " free:" + free +
          " limit:" + nodeReservedMemoryMB);
      }
      return false;
    }
    return true;
  }
473860
public synchronized boolean tryDelegateSlop(Node node) {
        if(asyncCallbackShouldSendhint) {
            return false;
        } else {
            slopDestinations.put(node, true);
            return true;
        }
    }
1114928
def node_changed(self, node):
        

        index = self.get_node_index(node)
        if index is not None:
            self.dataChanged.emit(index, index)
            return True
        else:
            return False
303664
private void add(Node node) {
    evict();

    if (handHot == null) {
      handHot = handCold = handTest = node;
      node.next = node.prev = node;
    } else {
      node.prev = handHot;
      node.next = handHot.next;
      handHot.next.prev = node;
      handHot.next = node;
    }
    if (handCold == handHot) {
      handCold = node.next;
    }
    if (handTest == handHot) {
      handTest = node.next;
    }
    handHot = node.next;
  }
646620
public void connect(Node<T> o, Node<T> t) {
    if (!o.equals(t)) {
      o.connectTo(t);
      t.connectTo(o);
    }
  }
1283636
private boolean linkFirst(Node<E> node) {
        // assert lock.isHeldByCurrentThread();
        if (count >= capacity)
            return false;
        Node<E> f = first;
        node.next = f;
        first = node;
        if (last == null)
            last = node;
        else
            f.prev = node;
        ++count;
        notEmpty.signal();
        return true;
    }
576506
public ByteSequenceIterator restartFrom(int node) {
    position = 0;
    bufferWrapper.clear();
    nextElement = null;

    pushNode(node);
    return this;
  }
423029
private boolean removeConvertedNodes(AbstractNode node) {
    boolean nodeRemoved = false;
    Iterator<AbstractNode> it = node.getChildren().iterator();
    while (it.hasNext()) {
      FilterJoinNode child = (FilterJoinNode) it.next();
      if (child.getState().equals(FilterJoinNode.State.CONVERTED)) {
        it.remove();
        nodeRemoved |= true;
      }
      else {
        nodeRemoved |= this.removeConvertedNodes(child) ? true : false;
      }
    }
    return nodeRemoved;
  }
1198226
public function prepend(?Node $node): bool {
        if ($node === null) {
            return false;
        }
        /*
         * need to clone the object otherwise the object
         * references are going crazy.
         *
         * Furthermore, setting previous and next to null
         * as they will be set later.
         */
        $newNode = clone $node;
        $newNode->setPrevious(null);
        $newNode->setNext(null);

        if ($this->getHead() === null) {
            $this->setHead($newNode);
            return true;
        }
        $head = $this->getHead();
        $head->setPrevious($newNode);
        $newNode->setNext($head);
        $this->setHead($newNode);
        return true;
    }
204159
public boolean isAncestor(XMLNode node) {
		return node == parent || (parent != null && parent.isAncestor(node));
	}
48079
def node_is_on_list(self, node):
        
        next = self.node_next(node)
        if next == node or next is None:
            assert(self.node_prev(node) is next)
            return False

        return True
699755
private Node enq(Node node) {
        for (;;) {
            Node oldTail = tail;
            if (oldTail != null) {
                U.putObject(node, Node.PREV, oldTail);
                if (compareAndSetTail(oldTail, node)) {
                    oldTail.next = node;
                    return oldTail;
                }
            } else {
                initializeSyncQueue();
            }
        }
    }
1284977
public static boolean hasMixin(final Node node) {
        try {
            return node.isNodeType(FEDORA_TIME_MAP);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
53356
public void releaseNode(final NodeId node) throws Exception {
		Lockable<SharedBufferNode> sharedBufferNode = sharedBuffer.getEntry(node);
		if (sharedBufferNode != null) {
			if (sharedBufferNode.release()) {
				removeNode(node, sharedBufferNode.getElement());
			} else {
				sharedBuffer.upsertEntry(node, sharedBufferNode);
			}
		}
	}
233712
static <K extends Comparable<K>> void checkNode(Node<K> node) {
        node.checkNode(null, null);
    }
572474
public void transferStart(QueueListener eventsToTransfer)
    {
        while (!eventsToTransfer.isEmpty()) {
            Event event = eventsToTransfer.removeLast();
            this.previousEvents.offerFirst(event);
        }
    }