public class SxLockPolicy extends Object implements LockPolicy<SxLockType>
| Constructor and Description |
|---|
SxLockPolicy(boolean starvation_allowed)
Creates a new SX locking policy.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
is_compatible(SxLockType lock_type_1,
SxLockType lock_type_2)
Checks if two locks are compatible.
|
SxLockType |
parent_lock(SxLockType 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 SxLockPolicy(boolean starvation_allowed)
starvation_allowed - is starvation allowed? (see
LockPolicy.starvation_allowed())public boolean is_compatible(SxLockType lock_type_1, SxLockType lock_type_2)
LockPolicyis_compatible in interface LockPolicy<SxLockType>lock_type_1 - the type of lock of one holderlock_type_2 - the type of lock of another holderpublic SxLockType parent_lock(SxLockType lock_type)
LockPolicyparent_lock in interface LockPolicy<SxLockType>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()
LockPolicystarvation_allowed in interface LockPolicy<SxLockType>Copyright © 2015. All rights reserved.