]> git.lizzy.rs Git - rust.git/commitdiff
core: Give task::spawn_with the documentation from task::run_with
authorBenjamin Herr <ben@0x539.de>
Mon, 9 Jul 2012 02:05:48 +0000 (04:05 +0200)
committerBenjamin Herr <ben@0x539.de>
Mon, 9 Jul 2012 03:02:05 +0000 (05:02 +0200)
src/libcore/task.rs

index c1030bc730a5d09f3d580076fa5a2cbdd5746e46..abba0c6d7f7b63e2360552fad0c706c46e06e0de 100644 (file)
@@ -405,15 +405,13 @@ fn spawn(+f: fn~()) {
 
 fn spawn_with<A:send>(+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)