EDU.oswego.cs.dl.util.concurrent

Class NullSync

public class NullSync extends Object implements Sync

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. ]

Method Summary
voidacquire()
booleanattempt(long msecs)
voidrelease()

Method Detail

acquire

public void acquire()

attempt

public boolean attempt(long msecs)

release

public void release()