EDU.oswego.cs.dl.util.concurrent
Class NullSync
java.lang.Object
EDU.oswego.cs.dl.util.concurrent.NullSync
- Sync
public class NullSync
extends java.lang.Object
A No-Op implementation of Sync. Acquire never blocks,
Attempt always succeeds, Release has no effect.
However, acquire and release do detect interruption
and throw InterruptedException. Also, the methods
are synchronized, so preserve memory barrier properties
of Syncs.
NullSyncs can be useful in optimizing classes when
it is found that locking is not strictly necesssary.
[
Introduction to this package. ]
acquire
public void acquire()
throws InterruptedException
- acquire in interface Sync
attempt
public boolean attempt(long msecs)
throws InterruptedException
- attempt in interface Sync