sod.exec
Class Lock

java.lang.Object
  |
  +--sod.exec.Lock
All Implemented Interfaces:
java.io.Serializable

public class Lock
extends java.lang.Object
implements java.io.Serializable

MUTEX. Object that is used to lock processes. Created in July 30, 2001.

Version:
1.0 June/2001
Author:
Nélio Alves Pereira Filho
, Ricardo Koji Ushizaki
See Also:
Serialized Form

Constructor Summary
Lock()
          Constructs a new lock.
 
Method Summary
 void lock()
          Acquires the lock.
 void unlock()
          Releases the lock, and notify only one thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lock

public Lock()
Constructs a new lock.
Method Detail

lock

public void lock()
          throws java.lang.InterruptedException
Acquires the lock. Keep waiting until lock is achieved.
Throws:
java.lang.InterruptedException - Some error occurs while waiting for lock.

unlock

public void unlock()
Releases the lock, and notify only one thread.