ucNewThread
See Also: ucReleaseItem, Thread
Handling
Allocates a new thread, and returns the new thread handle
for use in subsequent definitions.
ucNewThread([ParentThread])
Parameter
ParentThread
Optional. If this argument is supplied, then all
definitions from the parent thread are shared with the new thread. If this argument is omitted, then the
default thread is used as the parent thread.
The default thread is where all items in the include file (arithmetic
operators, data types, patterns, etc.) are defined.
Remarks
- uCalc
allows you to define a group of definitions into a given thread, so that
they are completely independent from definitions in other threads. Functions such as ucDefine,
ucDefineFunction, ucDefineVariable, etc., all have an optional last
argument that accepts a thread handle.
For that argument, you can use the handle supplied by ucNewThread. So, you might define function f(), and
variable x one way in one thread, and items with the same names a
different way in another thread.
See Thread Handling for more
details.
- The
syntax for ucNewThread is likely to change or it may be superseded by
another routine. This is likely to
be done in a way that does not break compatibility, or in a way that won't
compile with the old syntax as a way to alert the user to the change. For now, you can create a completely
independent thread (as opposed to one that is a child to the default
thread), with ucInitialize() instead of ucNewThread().
See this example.