org.objectweb.dream.synchro
Interface Mutex

All Known Subinterfaces:
MutexReEntrant
All Known Implementing Classes:
MutexImpl, MutexReEntrantImpl

public interface Mutex

A mutex component aims at synchronizing the execution of several components.


Field Summary
static String ITF_NAME
          The default name of the Mutexinterface.
 
Method Summary
 void lock()
          Acquires the mutex.
 boolean timedLock(long msecs)
          Tries to acquire the mutex.
 void unlock()
          Releases the mutex.
 

Field Detail

ITF_NAME

static final String ITF_NAME
The default name of the Mutexinterface.

See Also:
Constant Field Values
Method Detail

lock

void lock()
          throws InterruptedException
Acquires the mutex.

Throws:
InterruptedException - the thread is interrupted.

timedLock

boolean timedLock(long msecs)
                  throws InterruptedException
Tries to acquire the mutex.

Parameters:
msecs - the number of milliseconds to wait for the lock.
Returns:
true if the lock is acquired, false otherwise.
Throws:
InterruptedException - if the thread is interrupted.

unlock

void unlock()
Releases the mutex.



Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.