parrotcode: Threadsafe Queue | |
Contents | PMCs |
src/pmc/tqueue.pmc - Threadsafe Queue
Threadsafe queue class for inter thread communication. If you have an unthreaded program then please use an Array-like PMC.
new P0, 'TQueue'
push P0, some
new P2, 'ParrotThread'
...
and in other thread (at least, when shared PMCs work :)
shift P1, P0
Note: The TQueue must always be emptied before program exit.
void init()
PMC *clone()
void mark()
void destroy()
INTVAL defined()
INTVAL get_integer()
INTVAL elements()
void push_pmc(PMC *item)
*item
to the end of the queue.PMC *shift_pmc()
|