diff options
| author | Graydon Hoare <[email protected]> | 2010-08-10 13:26:00 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-10 13:26:00 -0700 |
| commit | dbe8760af3b50bfa14d39406fe0eca2f2b82d8ec (patch) | |
| tree | c5f89fa72e9c28ced0a533a498d64eee30f26f3f /doc | |
| parent | Fix a deque size bookkeeping bug. (diff) | |
| parent | Add names to tasks and domains. These can either be an explicit literal string (diff) | |
| download | rust-dbe8760af3b50bfa14d39406fe0eca2f2b82d8ec.tar.xz rust-dbe8760af3b50bfa14d39406fe0eca2f2b82d8ec.zip | |
Merge commit 'jyasskin/work'
Conflicts:
src/rt/rust_dom.cpp
src/rt/rust_upcall.cpp
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/rust.texi | 16 |
1 files changed, 10 insertions, 6 deletions
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; |