The OpenD Programming Language

spawnLinked

Starts fn(args) in a logical thread and will receive a LinkTerminated message when the operation terminates.

Executes the supplied function in a new logical thread represented by Tid. This new thread is linked to the calling thread so that if either it or the calling thread terminates a LinkTerminated message will be sent to the other, causing a LinkTerminated exception to be thrown on receive(). The owner relationship from spawn() is preserved as well, so if the link between threads is broken, owner termination will still result in an OwnerTerminated exception to be thrown on receive().

spawnLinked
(
F
T...
)
(
F fn
,)
if (
isSpawnable!(F, T)
)

Parameters

fn F

The function to execute.

args T

Arguments to the function.

Return Value

Type: Tid

A Tid representing the new thread.

Meta