1 13 14 package EDU.oswego.cs.dl.util.concurrent; 15 import java.util.*; 16 17 24 25 26 public class SyncSet extends SyncCollection implements Set { 27 28 34 public SyncSet(Set set, Sync sync) { 35 super (set, sync); 36 } 37 38 42 public SyncSet(Set set, ReadWriteLock rwl) { 43 super (set, rwl.readLock(), rwl.writeLock()); 44 } 45 46 50 public SyncSet(Set set, Sync readLock, Sync writeLock) { 51 super(set, readLock, writeLock); 52 } 53 54 public int hashCode() { 55 boolean wasInterrupted = beforeRead(); 56 try { 57 return c_.hashCode(); 58 } 59 finally { 60 afterRead(wasInterrupted); 61 } 62 } 63 64 public boolean equals(Object o) { 65 boolean wasInterrupted = beforeRead(); 66 try { 67 return c_.equals(o); 68 } 69 finally { 70 afterRead(wasInterrupted); 71 } 72 } 73 74 } 75 76 77 | Popular Tags |