public interface IRWLockManager<OBJECT,CONTEXT>
write
lock at the same time. It will privileges first context that has already a
read
lock. If no one has any read lock, it's "first come first serve".Modifier and Type | Interface and Description |
---|---|
static class |
IRWLockManager.LockType |
Modifier and Type | Method and Description |
---|---|
boolean |
hasLock(IRWLockManager.LockType type,
CONTEXT context,
OBJECT objectToLock) |
boolean |
hasLockByOthers(IRWLockManager.LockType type,
CONTEXT context,
OBJECT objectToLock) |
void |
lock(IRWLockManager.LockType type,
CONTEXT context,
Collection<? extends OBJECT> objectsToLock,
long timeout) |
void |
lock(IRWLockManager.LockType type,
CONTEXT context,
OBJECT objectToLock,
long timeout) |
void |
unlock(CONTEXT context)
Attempts to release all locks(read and write) for a given context.
|
void |
unlock(IRWLockManager.LockType type,
CONTEXT context,
Collection<? extends OBJECT> objectsToUnlock)
Attempts to release for a given locktype, context and objects.
|
static final int WAIT
static final int NO_WAIT
void lock(IRWLockManager.LockType type, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) throws InterruptedException
InterruptedException
void lock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock, long timeout) throws InterruptedException
InterruptedException
void unlock(IRWLockManager.LockType type, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
IllegalMonitorStateException
- Unlocking objects without lock.void unlock(CONTEXT context)
boolean hasLock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock)
boolean hasLockByOthers(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock)
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html