1 21 22 package org.apache.derbyTesting.unitTests.services; 23 24 import org.apache.derby.iapi.services.locks.*; 25 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 import java.util.Hashtable ; 28 29 35 36 class T_L1 implements Lockable { 37 38 long value = 0; 39 int count = 0; 40 41 Latch latch; 42 43 T_L1() { 44 } 45 46 49 50 54 public void lockEvent(Latch lockInfo) { 55 if (SanityManager.DEBUG) 56 SanityManager.ASSERT(lockInfo.getQualifier() == null); 57 58 latch = lockInfo; 59 60 count++; 61 } 62 63 public boolean requestCompatible(Object requestedQualifier, Object grantedQualifier) { 64 return false; 65 } 66 67 public boolean lockerAlwaysCompatible() { 68 return true; 69 } 70 71 75 public void unlockEvent(Latch lockInfo) { 76 if (SanityManager.DEBUG) 77 SanityManager.ASSERT(lockInfo.getQualifier() == null); 78 79 count--; 80 if (SanityManager.DEBUG) 81 SanityManager.ASSERT(count >= 0); 82 latch = null; 83 } 84 85 public boolean lockAttributes(int flag, Hashtable t) 86 { 87 return false; 88 } 89 } 90 | Popular Tags |