public class RefCountLockResource extends LockResource
mLock
Constructor and Description |
---|
RefCountLockResource(Lock lock,
boolean acquireLock,
AtomicInteger refCount)
Creates a new instance of
LockResource using the given lock and reference counter. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases the lock and decrement the ref count if a ref counter was provided
at construction time.
|
hasSameLock
public RefCountLockResource(Lock lock, boolean acquireLock, AtomicInteger refCount)
LockResource
using the given lock and reference counter. The
reference counter should have been initialized and incremented outside of this class.lock
- the lock to acquireacquireLock
- whether to lock the lockrefCount
- ref count for the lockpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class LockResource
Copyright © 2023. All Rights Reserved.