LockType
- the type of lockpublic interface LockPolicy<LockType>
LockType
which represents a type of lock. The policy
defines how different lock types operate with each other.Modifier and Type | Method and Description |
---|---|
boolean |
is_compatible(LockType lock_type_1,
LockType lock_type_2)
Checks if two locks are compatible.
|
LockType |
parent_lock(LockType 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.
|
boolean is_compatible(LockType lock_type_1, LockType lock_type_2)
lock_type_1
- the type of lock of one holderlock_type_2
- the type of lock of another holderLockType parent_lock(LockType lock_type)
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 chainboolean starvation_allowed()
Copyright © 2015. All rights reserved.