Threadclass provides an abstraction to the multi-threading facilities provided by the underlying operating system.
A new thread is started by the
performInThread with method provided
by the instance
All. The value returned by that method is the
Thread object of the newly created thread.
Every thread has an id. The id of the current thread is available
Thread class as
current_id. The main thread (which every
program has, even when running single-threaded) has id 0. Due to the
differences in target implementations, exiting the main thread, by
exit method, is not guaranteed not to exit
Multi-threading need not be available on all TOM targets. The
functioning method returns
FALSE on those targets on which
multi-threading is not available. However, a TOM programmer can
assume multi-threading to always be available.
static MutableEqSet threads;
local static public instance (id) current;
local static public int current_id;
TRUEiff we can run multiple threads on this target.
public int thread_id;
void exit int rc pre self == [#
protected id (self) init int th_id;