joeq.Runtime
Class Monitor

java.lang.Object
  extended by joeq.Runtime.Monitor

public class Monitor
extends Object


Field Summary
static jq_InstanceField _atomic_count
           
static jq_Class _class
           
static jq_StaticMethod _monitorenter
           
static jq_StaticMethod _monitorexit
           
static boolean TRACE
           
 
Method Summary
static Monitor allocateInflatedLock()
           
 void free()
           
static int getLockEntryCount(Object k)
          Returns the depth of the lock on the given object.
static Monitor getMonitor(int lockword)
          Get the Monitor object associated with this lockword.
static void installInflatedLock(Object k, Monitor m)
          Installs an inflated lock on the given object.
 void lock(jq_Thread t)
          Lock this monitor with the given thread block.
static void monitorenter(Object k)
          Monitorenter runtime routine.
static void monitorexit(Object k)
          Monitorexit runtime routine.
 void releaseSemaphore()
          Create a semaphore if there isn't one already, and release it.
 void unlock(jq_Thread t)
          Unlock this monitor with the given thread block.
 void waitOnSemaphore()
          Create a semaphore if there isn't one already, and wait on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static boolean TRACE

_class

public static final jq_Class _class

_monitorenter

public static final jq_StaticMethod _monitorenter

_monitorexit

public static final jq_StaticMethod _monitorexit

_atomic_count

public static final jq_InstanceField _atomic_count
Method Detail

getLockEntryCount

public static int getLockEntryCount(Object k)
Returns the depth of the lock on the given object.


monitorenter

public static void monitorenter(Object k)
Monitorenter runtime routine. Checks for thin lock usage, otherwise falls back to inflated locks.


monitorexit

public static void monitorexit(Object k)
Monitorexit runtime routine. Checks for thin lock usage, otherwise falls back to inflated locks.


getMonitor

public static Monitor getMonitor(int lockword)
Get the Monitor object associated with this lockword.


allocateInflatedLock

public static Monitor allocateInflatedLock()

free

public void free()

installInflatedLock

public static void installInflatedLock(Object k,
                                       Monitor m)
Installs an inflated lock on the given object. Uses a spin-loop to wait until the object is unlocked or inflated.


lock

public void lock(jq_Thread t)
Lock this monitor with the given thread block.


unlock

public void unlock(jq_Thread t)
Unlock this monitor with the given thread block.


waitOnSemaphore

public void waitOnSemaphore()
Create a semaphore if there isn't one already, and wait on it.


releaseSemaphore

public void releaseSemaphore()
Create a semaphore if there isn't one already, and release it.



Copyright © 2001-2005 John Whaley. All Rights Reserved.