A Deque is a double-ended queue with a pop method that can block until an element is available. It is commonly used to synchronize threads.


You can create deque using method:

Lib.Sys.VM.Deque.new()

Create a new Deque instance which is initially empty.



Created deque has methods:

add(i)

Adds an element at the end of this Deque.

i - element

pop(block)

Tries to retrieve an element from the front of this Deque.

If an element is available, it is removed from the queue and returned.

If no element is available and block is false, nil is returned.

Otherwise, execution blocks until an element is available and returns it.

block - true/false, deque reading blocking condition

push(i)

Adds an element at the front of this Deque.

i - element


Created with the Personal Edition of HelpNDoc: Full-featured Help generator