Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jacomma.util
Class RdWrLock  view RdWrLock download RdWrLock.java

java.lang.Object
  extended byjacomma.util.RdWrLock

public class RdWrLock
extends java.lang.Object

A recursive (re-enterant) read-write Lock implementation with single reader priviledge elevation and deadlock detection


Nested Class Summary
private  class RdWrLock.LockCount
           
 
Field Summary
private  java.util.Map readers_
           
private  RdWrLock.LockCount writer_
           
 
Constructor Summary
RdWrLock()
           
 
Method Summary
private  boolean _try_rdlock()
           
private  boolean _try_wrlock()
           
 void rdlock()
           
 boolean try_rdlock()
           
 boolean try_wrlock()
           
 void unlock()
          Releases (decrements count) a lock ownder by the current thread Nothing happens if the thread is not a lock owner
 void wrlock()
          Acquires a write-lock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readers_

private java.util.Map readers_

writer_

private RdWrLock.LockCount writer_
Constructor Detail

RdWrLock

public RdWrLock()
Method Detail

rdlock

public void rdlock()

wrlock

public void wrlock()
Acquires a write-lock.


try_rdlock

public boolean try_rdlock()

try_wrlock

public boolean try_wrlock()

unlock

public void unlock()
Releases (decrements count) a lock ownder by the current thread Nothing happens if the thread is not a lock owner


_try_rdlock

private boolean _try_rdlock()

_try_wrlock

private boolean _try_wrlock()