index Zimbu documentation

MODULE THREAD @public

summary

     

Classes and methods for thread support.

Still very much under development.

ENUM  State @public  The possible states a thread can be in.
ENUM  Type @public  The possible types of threads.
CLASS  E_Thread @public  Exception thrown when there is a thread related error.
CLASS  ThreadBase @public  Base class for Thread and EvalThread
CLASS  Thread @public  The builtin type thread.
CLASS  EvalThread<Titem> @public  Thread to be used for evaluating a function and returning the result through a pipe.
CLASS  Lock @public  The builtin type lock: An object to get exclusive access.
CLASS  AutoLock @public  The builtin type autoLock: an object that keeps a lock and releases it when destructed.
CLASS  Cond @public  The builtin type cond: An object to wait on a condition.
 
eval<Titem>(f) pipe<Titem> @public  Create a thread to evaluate f and return a pipe from which the result can be read.
threads() list<thread> @public  Return a list of all currently created threads. TODO
current() thread @public  Return the object associated with the current thread. TODO
wait() @public  Blocks until all threads, except the current one, have finished.
 

members (alphabetically)

     

FUNC current() thread @public

     

Return the object associated with the current thread. TODO

Not Implemented Yet

FUNC eval<Titem>(func< => Titem> f) pipe<Titem> @public

     

Create a thread to evaluate f and return a pipe from which the result can be read.

Example:

 pipe<string> p = THREAD.eval({ => "hello there" })
 IO.print(p.read())

FUNC threads() list<thread> @public

     

Return a list of all currently created threads. TODO

Thread objects that have been created but for which start() has not been invoked are not included.

Not Implemented Yet

PROC wait() @public

     

Blocks until all threads, except the current one, have finished.

Not Implemented Yet

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0