private Node enq(final Node node) { for (;;) { Node t = tail; if (t == null) { // Must initialize if (compareAndSetHead(new Node())) tail = head; } else { node.prev = t; if (compareAndSetTail(t, node)) { t.next = node; return t; } } } } 只是简单的生成一个 node 作为 head ,将参数 node 变为 tail , 最后将 tail 的 prev 指向 head ,head 的 next 指向 tail 。 大牛炫技 