Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public String value;
  2. public AtomicReference<Node> next;
  3. **************************************
  4. Node head;
  5. final Node tail;
  6. //@ -> O -> O -> ... -> @ -<
  7. public void push(String x) {
  8. Node newNode = new Node(x, head.next.get());
  9. while(!head.next.compareAndSet(newNode.next.get(), newNode)) {
  10. newNode.next.set(head.next.get());
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement