Atavism Version 2018.1AGIS API

atavism.server.util
Class AOLock

java.lang.Object
  extended by java.util.concurrent.locks.ReentrantLock
      extended by atavism.server.util.AOLock
All Implemented Interfaces:
java.io.Serializable, java.util.concurrent.locks.Lock

public class AOLock
extends java.util.concurrent.locks.ReentrantLock

this lock keeps track of its call stack. it can also timeout and throw an exception (to help debug deadlocks). the exception will have all locks when you call lock() it adds to the stack. when you call unlock() it removes from the stack. you can get the lock's stack by calling getStack()

See Also:
Serialized Form

Constructor Summary
AOLock(java.lang.String name)
           
 
Method Summary
 java.lang.String getLockName()
           
 void lock()
           
 void lock(long lockTimeoutMS)
           
static void setDeadlockTimeout(int timeoutMS)
          time in MS before the deadlock code kicks in.
 void setName(java.lang.String name)
           
 void unlock()
           
 
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lockInterruptibly, newCondition, toString, tryLock, tryLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AOLock

public AOLock(java.lang.String name)
Method Detail

setName

public void setName(java.lang.String name)

getLockName

public java.lang.String getLockName()

lock

public void lock()
Specified by:
lock in interface java.util.concurrent.locks.Lock
Overrides:
lock in class java.util.concurrent.locks.ReentrantLock

lock

public void lock(long lockTimeoutMS)

unlock

public void unlock()
Specified by:
unlock in interface java.util.concurrent.locks.Lock
Overrides:
unlock in class java.util.concurrent.locks.ReentrantLock

setDeadlockTimeout

public static void setDeadlockTimeout(int timeoutMS)
time in MS before the deadlock code kicks in.



Copyright © 2018 Dragonsan Studios Sp. z o.o.