Atavism Version 2018.1AGIS API

atavism.server.util
Class DLock

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

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

detection or debug lock

See Also:
Serialized Form

Method Summary
static java.util.Set<java.util.List<DLock>> detectCycle()
          goes through the lock ordering map and looks for any cycles returns a set of cycles
protected static java.util.Set<java.util.List<DLock>> detectCycleHelper(DLock node, java.util.List<DLock> history, java.util.HashSet<DLock> cycleNodes)
           
protected static java.util.Set<DLock> getChildNodes()
           
 java.lang.String getLockName()
           
protected static java.util.Set<DLock> getTopNodes(java.util.Set<DLock> childNodes)
           
protected static boolean isSubset(java.util.List<DLock> subset, java.util.List<DLock> superset)
           
protected static boolean isSubset(java.util.List<DLock> set, java.util.Set<java.util.List<DLock>> allSets)
           
 void lock()
           
 void lock(boolean acquireLock)
           
 void lockInterruptibly()
           
static void main(java.lang.String[] args)
           
static java.lang.String makeStackDumpString(java.lang.StackTraceElement[] stackArray)
          turn the stacktrace dump into a string
 java.util.concurrent.locks.Condition newCondition()
           
protected static void printCycle(java.util.List<DLock> cycle)
           
 void setName(java.lang.String name)
           
protected static void stackDump(java.util.List<DLock> nodes)
          given the sequence of nodes which led to a cycle, this method will print out the stack dumps for each lock sequence assumes we have synchronized the DLock.class object
 java.lang.String toString()
           
 boolean tryLock()
           
 boolean tryLock(long time, java.util.concurrent.TimeUnit unit)
           
 void unlock()
           
 
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.util.concurrent.locks.ReentrantLock

setName

public void setName(java.lang.String name)

getLockName

public java.lang.String getLockName()

tryLock

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

tryLock

public boolean tryLock(long time,
                       java.util.concurrent.TimeUnit unit)
                throws java.lang.InterruptedException
Specified by:
tryLock in interface java.util.concurrent.locks.Lock
Overrides:
tryLock in class java.util.concurrent.locks.ReentrantLock
Throws:
java.lang.InterruptedException

lockInterruptibly

public void lockInterruptibly()
                       throws java.lang.InterruptedException
Specified by:
lockInterruptibly in interface java.util.concurrent.locks.Lock
Overrides:
lockInterruptibly in class java.util.concurrent.locks.ReentrantLock
Throws:
java.lang.InterruptedException

newCondition

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

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(boolean acquireLock)

unlock

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

detectCycle

public static java.util.Set<java.util.List<DLock>> detectCycle()
goes through the lock ordering map and looks for any cycles returns a set of cycles


isSubset

protected static boolean isSubset(java.util.List<DLock> set,
                                  java.util.Set<java.util.List<DLock>> allSets)

isSubset

protected static boolean isSubset(java.util.List<DLock> subset,
                                  java.util.List<DLock> superset)

getChildNodes

protected static java.util.Set<DLock> getChildNodes()

getTopNodes

protected static java.util.Set<DLock> getTopNodes(java.util.Set<DLock> childNodes)

detectCycleHelper

protected static java.util.Set<java.util.List<DLock>> detectCycleHelper(DLock node,
                                                                        java.util.List<DLock> history,
                                                                        java.util.HashSet<DLock> cycleNodes)

stackDump

protected static void stackDump(java.util.List<DLock> nodes)
given the sequence of nodes which led to a cycle, this method will print out the stack dumps for each lock sequence assumes we have synchronized the DLock.class object


printCycle

protected static void printCycle(java.util.List<DLock> cycle)

makeStackDumpString

public static java.lang.String makeStackDumpString(java.lang.StackTraceElement[] stackArray)
turn the stacktrace dump into a string


main

public static void main(java.lang.String[] args)


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