Skip to content
SinisterRectus edited this page Mar 4, 2017 · 7 revisions

Mutual exclusion class for coroutines.

Properties Inherited From Deque

Name Type Mutable Description
count number How many objects are in the deque

Class Properties

Name Type Mutable Description
active boolean Indicates whether the mutex is in use.

Methods Inherited From Deque

Prototype Interface Description
iter() Local Returns an iterator for the objects in the deque, from left to right.
peekLeft() Local Returns the object at the left side of the deque, but does not pop it.
peekRight() Local Returns the object at the right side of the deque, but does not pop it.
popLeft() Local Pop an object from the left side of the deque and return it.
popRight() Local Pop and object from the right side of the deque and return it.
pushLeft(obj) Local Push an object to the left side of the deque.
pushRight(obj) Local Push an object to the right side of the deque.

Class Methods

Prototype Interface Description
lock([isRetry]) Local Activates the mutex if not already active, or, enqueues and yields the current coroutine.
unlock() Local Dequeues and resumes a coroutine if one exists, or, deactives the mutex.
unlockAfter(delay) Local Unlocks the mutex after x miliseconds.
Clone this wiki locally