From cf4d5f4e4c4b1f853e2491be6c9440c2920e640d Mon Sep 17 00:00:00 2001 From: Benjamin Herr Date: Mon, 9 Jul 2012 04:05:48 +0200 Subject: [PATCH] core: Give task::spawn_with the documentation from task::run_with --- src/libcore/task.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libcore/task.rs b/src/libcore/task.rs index c1030bc730a..abba0c6d7f7 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -405,15 +405,13 @@ fn spawn(+f: fn~()) { fn spawn_with(+arg: A, +f: fn~(+A)) { /*! - * Runs a new task while providing a channel from the parent to the child + * Runs a task, while transfering ownership of one argument to the + * child. * - * Sets up a communication channel from the current task to the new - * child task, passes the port to child's body, and returns a channel - * linked to the port to the parent. + * This is useful for transfering ownership of noncopyables to + * another task. * - * This encapsulates some boilerplate handshaking logic that would - * otherwise be required to establish communication from the parent - * to the child. + * This function is equivalent to `run_with(builder(), arg, f)`. */ run_with(builder(), arg, f)