HPSearch

cgl.hpsearch.common.sync
Class Lock

java.lang.Object
  extended bycgl.hpsearch.common.sync.Lock

public class Lock
extends Object

Implementation of a Lock that locks up a thread until its awoken using signal() Created on Mar 14, 2005

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Field Summary
static int LOCKED
           
static int UNLOCKED
           
 
Constructor Summary
Lock()
           
 
Method Summary
 void lock()
          Locks the current thread
static void main(String[] a)
          Testing purposes only
 void sleep(long timeout)
           
 void unlock()
          Unlocks the locked thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCKED

public static final int LOCKED
See Also:
Constant Field Values

UNLOCKED

public static final int UNLOCKED
See Also:
Constant Field Values
Constructor Detail

Lock

public Lock()
Method Detail

lock

public void lock()
Locks the current thread


sleep

public void sleep(long timeout)

unlock

public void unlock()
Unlocks the locked thread


main

public static void main(String[] a)
Testing purposes only

Parameters:
a -

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006