1 /** Locking aspect. 2 * @author Garrett Smith 3 * <p> 4 * Aspect that can be used for AsyncRequest, Animation, or anything that 5 * involves setTimeout or setInterval. 6 * </p> 7 * Adds an <code>__ape_lock_has_lock</code> property to the object it locks on. Just ignore this. 8 * 9 * @aspect 10 * @scope {Object} Anything. APE.lock has no use independently - 11 * it is purely a locking mechanism. 12 * @class 13 */ 14 APE.Lock = { 15 getLock : function() { 16 if(this.__ape_lock_has_lock) return false; 17 return this.__ape_lock_has_lock = true; 18 }, 19 releaseLock : function() { 20 this.__ape_lock_has_lock = false; 21 }, 22 isLocked : function() { 23 return (true === this.__ape_lock_has_lock); 24 } 25 }; 26