1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

Improve Javadoc

This commit is contained in:
Martin Oberhuber 2007-02-09 09:59:28 +00:00
parent df030c023f
commit f62d052091

View file

@ -19,11 +19,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
* A Mutual Exclusion Lock for Threads that need to access a resource
* in a serialized manner.
* in a serialized manner. An Eclipse ProgressMonitor is accepted
* in order to support cancellation when waiting for the Mutex.
*
* Usage Example:
* <code>
* private Mutex fooMutex;
* private Mutex fooMutex = new Mutex();
* boolean doFooSerialized()(IProgressMonitor monitor) {
* if (fooMutex.waitForLock(monitor, 1000)) {
* try {
@ -35,11 +36,20 @@ import org.eclipse.core.runtime.IProgressMonitor;
* return false;
* }
* </code>
*
* The Mutex is not reentrant, so when a Thread has locked the
* Mutex it must not try locking it again.
*/
public class Mutex {
private boolean fLocked = false;
private List fWaitQueue = new LinkedList();
/**
* Creates an instance of <tt>Mutex</tt>.
*/
public Mutex() {
}
/**
* Try to acquire the lock maintained by this mutex.