org.apache.avalon.excalibur.concurrent
Interface Sync
- All Known Implementing Classes:
- Semaphore
- public interface Sync
The interface to synchronization objects.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.4 $ $Date: 2001/12/11 09:53:28 $
- Author:
- Peter Donald
Method Summary |
void |
acquire()
Aquire access to resource. |
boolean |
attempt(long msec)
Aquire access to resource. |
void |
release()
Release lock. |
acquire
public void acquire()
throws java.lang.InterruptedException
- Aquire access to resource.
This method will block until resource aquired.
- Throws:
java.lang.InterruptedException
- if an error occurs
attempt
public boolean attempt(long msec)
throws java.lang.InterruptedException
- Aquire access to resource.
This method will block for a maximum of msec.
- Parameters:
msec
- the duration to wait for lock to be released- Returns:
- true if lock aquired, false on timeout
- Throws:
java.lang.InterruptedException
- if an error occurs
release
public void release()
- Release lock.
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.