public class MutexLockPolicy extends Object implements LockPolicy<MutexLockType>
Constructor and Description |
---|
MutexLockPolicy()
Creates a new mutex locking policy.
|
Modifier and Type | Method and Description |
---|---|
boolean |
is_compatible(MutexLockType lock_type_1,
MutexLockType lock_type_2)
Checks if two locks are compatible.
|
MutexLockType |
parent_lock(MutexLockType lock_type)
Determines what is the type of lock a parent of a target should have.
|
boolean |
starvation_allowed()
If starvation is allowed compatible locks can be acquired even if there
are locks waiting.
|
public boolean is_compatible(MutexLockType lock_type_1, MutexLockType lock_type_2)
LockPolicy
is_compatible
in interface LockPolicy<MutexLockType>
lock_type_1
- the type of lock of one holderlock_type_2
- the type of lock of another holderpublic MutexLockType parent_lock(MutexLockType lock_type)
LockPolicy
parent_lock
in interface LockPolicy<MutexLockType>
lock_type
- the type of lock held by the targetlock_type
; this must not return null
as the parent must have some lock type to generate the
lock chainpublic boolean starvation_allowed()
LockPolicy
starvation_allowed
in interface LockPolicy<MutexLockType>
Copyright © 2015. All rights reserved.