Skip to content

Commit e767e25

Browse files
committed
---
yaml --- r: 36733 b: refs/heads/try2 c: b0fc222 h: refs/heads/master i: 36731: b00ce58 v: v3
1 parent 6b01cc0 commit e767e25

File tree

2 files changed

+4
-64
lines changed

2 files changed

+4
-64
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: a9601bce10ac5d037b0d1ce532196f08f4b7fd95
8+
refs/heads/try2: b0fc222fda0e49d55ac3eaf0ca35a43f6d9ed626
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/rust.md

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -858,13 +858,14 @@ If a sequence of such redirections form a cycle or cannot be unambiguously resol
858858

859859
An example of re-exporting:
860860
~~~~
861+
# fn main() { }
861862
mod quux {
862-
mod foo {
863+
pub mod foo {
863864
pub fn bar() { }
864865
pub fn baz() { }
865866
}
866867
867-
pub use foo::*;
868+
pub use quux::foo::*;
868869
}
869870
~~~~
870871

@@ -3036,67 +3037,6 @@ An executing task can yield control at any time, by making a library call to
30363037
non-executing state (blocked, dead) similarly deschedules the task.
30373038

30383039

3039-
### Spawning tasks
3040-
3041-
A call to `core::task::spawn`, passing a 0-argument function as its single
3042-
argument, causes the runtime to construct a new task executing the passed
3043-
function. The passed function is referred to as the _entry function_ for
3044-
the spawned task, and any captured environment it carries is moved from the
3045-
spawning task to the spawned task before the spawned task begins execution.
3046-
3047-
The result of a `spawn` call is a `core::task::Task` value.
3048-
3049-
An example of a `spawn` call:
3050-
3051-
~~~~
3052-
let po = comm::Port();
3053-
let ch = comm::Chan(&po);
3054-
3055-
do task::spawn {
3056-
// let task run, do other things
3057-
...
3058-
comm::send(ch, true);
3059-
};
3060-
3061-
let result = comm::recv(po);
3062-
~~~~
3063-
3064-
3065-
### Sending values into channels
3066-
3067-
Sending a value into a channel is done by a library call to `core::comm::send`,
3068-
which takes a channel and a value to send, and moves the value into the
3069-
channel's outgoing buffer.
3070-
3071-
An example of a send:
3072-
3073-
~~~~
3074-
let po = comm::Port();
3075-
let ch = comm::Chan(&po);
3076-
comm::send(ch, ~"hello, world");
3077-
~~~~
3078-
3079-
3080-
### Receiving values from ports
3081-
3082-
Receiving a value is done by a call to the `recv` method on a value of type
3083-
`core::comm::Port`. This call causes the receiving task to enter the *blocked
3084-
reading* state until a value arrives in the port's receive queue, at which
3085-
time the port deques a value to return, and un-blocks the receiving task.
3086-
3087-
An example of a *receive*:
3088-
3089-
~~~~~~~~
3090-
# let po = comm::Port();
3091-
# let ch = comm::Chan(&po);
3092-
# comm::send(ch, ~"");
3093-
let s = comm::recv(po);
3094-
~~~~~~~~
3095-
3096-
> **Note:** this communication system will be replaced by a higher-performance system called "pipes",
3097-
> in future versions of Rust.
3098-
3099-
31003040
# Runtime services, linkage and debugging
31013041

31023042

0 commit comments

Comments
 (0)