From b71340552fa0caa870877f87a1273e8d4c91efe6 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Sun, 8 Aug 2010 19:24:35 -0700 Subject: Add names to tasks and domains. These can either be an explicit literal string after the "spawn" keyword, or implicitly the call expression used to start the spawn. --- doc/rust.texi | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'doc/rust.texi') diff --git a/doc/rust.texi b/doc/rust.texi index 3aa079d7..63181f88 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -2822,12 +2822,15 @@ x.y = z + 2; @c * Ref.Stmt.Spawn:: Statements creating new tasks. @cindex Spawn statement -A @code{spawn} statement consists of keyword @code{spawn}, followed by a -normal @emph{call} statement (@pxref{Ref.Stmt.Call}). A @code{spawn} -statement causes the runtime to construct a new task executing the called -function. The called function is referred to as the @dfn{entry function} for -the spawned task, and its arguments are copied from the spawning task to the -spawned task before the spawned task begins execution. +A @code{spawn} statement consists of keyword @code{spawn}, followed by +an optional literal string naming the new task and then a normal +@emph{call} statement (@pxref{Ref.Stmt.Call}). A @code{spawn} +statement causes the runtime to construct a new task executing the +called function with the given name. The called function is referred +to as the @dfn{entry function} for the spawned task, and its arguments +are copied from the spawning task to the spawned task before the +spawned task begins execution. If no explicit name is present, the +task is implicitly named with the string of the call statement. Functions taking alias-slot arguments, or returning non-nil values, cannot be spawned. Iterators cannot be spawned. @@ -2843,6 +2846,7 @@ fn helper(chan[u8] out) @{ let port[u8] out; let task p = spawn helper(chan(out)); +let task p2 = spawn "my_helper" helper(chan(out)); // let task run, do other things. auto result <- out; -- cgit v1.2.3