Package de.flapdoodle.kfx.events
Class SharedLock
-
- All Implemented Interfaces:
public final class SharedLock<T extends Object>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSharedLock.Lock
-
Constructor Summary
Constructors Constructor Description SharedLock()
-
Method Summary
Modifier and Type Method Description final Pair<T, Object>getCurrent()final UnitsetCurrent(Pair<T, Object> current)final UnittryLock(T owner, Function0<Object> lockFactory)final UnittryIfLock(T owner, Function0<Object> lockFactory)final <K extends Any> UnitifLocked(T owner, Class<K> lockType, Function1<SharedLock.Lock<T, T, K>, Unit> onLocked)final <O extends T, K extends Any> UnitifLocked(Class<O> ownerType, Class<K> lockType, Function1<SharedLock.Lock<T, O, K>, Unit> onLocked)final <K extends Any> UnittryRelease(T owner, Class<K> lockType, Function1<K, Unit> onRelease)final UnitifUnlocked(Function0<Unit> onUnlocked)StringtoString()-
-
Method Detail
-
getCurrent
final Pair<T, Object> getCurrent()
-
setCurrent
final Unit setCurrent(Pair<T, Object> current)
-
tryLock
@Synchronized() final Unit tryLock(T owner, Function0<Object> lockFactory)
-
tryIfLock
@Synchronized() final Unit tryIfLock(T owner, Function0<Object> lockFactory)
-
ifLocked
final <K extends Any> Unit ifLocked(T owner, Class<K> lockType, Function1<SharedLock.Lock<T, T, K>, Unit> onLocked)
-
ifLocked
final <O extends T, K extends Any> Unit ifLocked(Class<O> ownerType, Class<K> lockType, Function1<SharedLock.Lock<T, O, K>, Unit> onLocked)
-
tryRelease
final <K extends Any> Unit tryRelease(T owner, Class<K> lockType, Function1<K, Unit> onRelease)
-
ifUnlocked
@Synchronized() final Unit ifUnlocked(Function0<Unit> onUnlocked)
-
toString
@Synchronized() String toString()
-
-
-
-