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 Ψ-lock
object.
-
-
Constructor Summary
Constructors Constructor Description PsyLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isHeldByCurrentThread()
Queries if this lock is held by the current thread.void
lock()
Acquires the lock.PsyCondition
psyCondition()
Returns a Ψ-condition
for use with this lock.void
unlock()
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
-
-
-
-
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:
true
if current context holds this lock andfalse
otherwise.
-
psyCondition
public PsyCondition psyCondition()
Returns a Ψ-condition
for use with this lock.- Returns:
- a Ψ-
condition
object.
-
-