Package edu.tufts.hrilab.action.lock
Class ActionResourceLockLinear
java.lang.Object
edu.tufts.hrilab.action.lock.ActionResourceLock
edu.tufts.hrilab.action.lock.ActionResourceLockLinear
- All Implemented Interfaces:
Serializable
ActionResourceLockLinear
implements FCFS locks--no preemption
based on priority.- See Also:
-
Field Summary
Fields inherited from class edu.tufts.hrilab.action.lock.ActionResourceLock
blinkLock, faceLock, headLock, lightLock, lockName, motionLock, owner, speechLock, transmitLock, visionLock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acquire
(ActionInterpreter actionInt, int count) Makecount
attempts to acquire this resource lock.static void
Methods inherited from class edu.tufts.hrilab.action.lock.ActionResourceLock
blockingAcquire, deepRelease, deepReleaseAll, getLock, getLockName, getOwner, nonBlockingAcquire, release, toString
-
Constructor Details
-
ActionResourceLockLinear
Constructor for a resource lock.- Parameters:
name
- the lock's name
-
-
Method Details
-
acquire
Makecount
attempts to acquire this resource lock.- Specified by:
acquire
in classActionResourceLock
- Parameters:
actionInt
- the ActionInterpreter requesting the lockcount
- the maximum number of attempts to acquire the lock- Returns:
- true if the lock is successfully acquired, false otherwise
-
initResources
public static void initResources()
-