stdlib: Update the example in std::comm
Due to a bug in channel destructors this examples fails when logging is off Issue #1155
This commit is contained in:
parent
12f2b4989e
commit
2e8ebb7c27
1 changed files with 2 additions and 3 deletions
|
@ -15,15 +15,14 @@ shared boxes (@T) may not be transmitted across channels.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
> use std::task;
|
> use std::{task, comm, io};
|
||||||
> use std::comm;
|
|
||||||
>
|
>
|
||||||
> let p = comm::port();
|
> let p = comm::port();
|
||||||
> task::spawn(comm::chan(p), fn (c: chan<str>) {
|
> task::spawn(comm::chan(p), fn (c: chan<str>) {
|
||||||
> comm::send(c, "Hello, World");
|
> comm::send(c, "Hello, World");
|
||||||
> });
|
> });
|
||||||
>
|
>
|
||||||
> log comm::recv(p);
|
> io::println(comm::recv(p));
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue