1 23 24 29 42 43 48 49 package com.sun.enterprise.util.collection; 50 51 public class SynchronizedDListNode 52 extends DListNode 53 { 54 public SynchronizedDListNode() { 55 } 56 57 public SynchronizedDListNode(Object obj) { 58 this.object = obj; 59 } 60 61 public void delink() { 62 synchronized (prev) { 63 synchronized (this) { 64 prev.next = next; 65 next.prev = prev; 66 prev = next = null; 67 } 68 } 69 } 70 71 public void insertBefore(DListNode node) { 72 synchronized (prev) { 73 synchronized (this) { 74 node.prev = prev; 75 node.next = this; 76 prev.next = node; 77 prev = node; 78 } 79 } 80 } 81 82 public void insertAfter(DListNode node) { 83 next.insertBefore(node); 84 } 85 86 } 87 | Popular Tags |