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 TypeMethodDescriptionbooleanacquire(ActionInterpreter actionInt, int count) Makecountattempts to acquire this resource lock.static voidMethods 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
Makecountattempts to acquire this resource lock.- Specified by:
acquirein 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()
-