DRCL J-Sim API

drcl.comp
Class LockPack

java.lang.Object
  extended bydrcl.comp.LockPack
All Implemented Interfaces:
Component.Locks

public class LockPack
extends java.lang.Object
implements Component.Locks

Data structure of a lock. Multiple locks can be chained to form a linked list.


Field Summary
 int counter
          The number of times the holder thread grabs the lock.
 WorkerThread holder
          Thread that holds the lock of the target object.
 int lockReqCount
          The number of threads competing for the lock of the target object.
 LockPack next
          Next lock pack in the chain.
 java.lang.Object target
          The target object being locked or waited on.
 int waitCount
          The number of threads waiting on the target object.
 
Constructor Summary
LockPack(java.lang.Object target_)
           
 
Method Summary
 java.lang.String printAll()
          Returns all the locks' and waiting threads' information.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

target

public java.lang.Object target
The target object being locked or waited on.


holder

public WorkerThread holder
Thread that holds the lock of the target object.


counter

public int counter
The number of times the holder thread grabs the lock.


lockReqCount

public int lockReqCount
The number of threads competing for the lock of the target object.


waitCount

public int waitCount
The number of threads waiting on the target object.


next

public LockPack next
Next lock pack in the chain.

Constructor Detail

LockPack

public LockPack(java.lang.Object target_)
Method Detail

printAll

public java.lang.String printAll()
Description copied from interface: Component.Locks
Returns all the locks' and waiting threads' information.

Specified by:
printAll in interface Component.Locks

toString

public java.lang.String toString()

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~