Skip to content

Commit c670d23

Browse files
committed
---
yaml --- r: 40828 b: refs/heads/dist-snap c: b0fc222 h: refs/heads/master v: v3
1 parent 21b0e18 commit c670d23

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: a9601bce10ac5d037b0d1ce532196f08f4b7fd95
10+
refs/heads/dist-snap: b0fc222fda0e49d55ac3eaf0ca35a43f6d9ed626
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)