Package coneforest.psylla.core
Class PsyLock
- java.lang.Object
-
- coneforest.psylla.core.PsyLock
-
- All Implemented Interfaces:
PsyConvertableToName,PsyConvertableToString,PsyObject
public class PsyLock extends Object implements PsyObject
A representation of Ψ-lockobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Constructor Summary
Constructors Constructor Description PsyLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisHeldByCurrentThread()Queries if this lock is held by the current thread.voidlock()Acquires the lock.PsyConditionpsyCondition()Returns a Ψ-conditionfor use with this lock.voidunlock()Releases the lock.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Method Detail
-
lock
public void lock()
Acquires the lock.
-
unlock
public void unlock()
Releases the lock.
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
Queries if this lock is held by the current thread.- Returns:
trueif current context holds this lock andfalseotherwise.
-
psyCondition
public PsyCondition psyCondition()
Returns a Ψ-conditionfor use with this lock.- Returns:
- a Ψ-
conditionobject.
-
-