Skip to content
SinisterRectus edited this page Nov 8, 2016 · 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 Description
iter() Returns an iterator for the objects in the deque, from left to right.
peekLeft() Returns the object at the left side of the deque, but does not pop it.
peekRight() Returns the object at the right side of the deque, but does not pop it.
popLeft() Pop an object from the left side of the deque and return it.
popRight() Pop and object from the right side of the deque and return it.
pushLeft(obj) Push an object to the left side of the deque.
pushRight(obj) Push an object to the right side of the deque.

Class Methods

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