about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-07 03:46:37 -0700
committerbors <bors@rust-lang.org>2014-04-07 03:46:37 -0700
commit8902ed0c6538bd9cf40348e923fed24654c4fa34 (patch)
treeeee659dc2c5d097a49043840f34971fc9fd99136 /src/libstd
parent0deb16a54e771f4adec773451c1eed2ddde417ab (diff)
parent137e648eddb53b56cd0d3eba992a975456da44d2 (diff)
downloadrust-8902ed0c6538bd9cf40348e923fed24654c4fa34.tar.gz
rust-8902ed0c6538bd9cf40348e923fed24654c4fa34.zip
auto merge of #13354 : alexcrichton/rust/fixup-some-signals, r=sfackler
This also makes the listener struct sendable again by explicitly putting the
Send bound on the relevant Rtio object.

cc #13352
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/signal.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs
index 494cc6f6b02..6762e7c6a76 100644
--- a/src/libstd/io/signal.rs
+++ b/src/libstd/io/signal.rs
@@ -23,6 +23,7 @@ use clone::Clone;
 use comm::{Sender, Receiver, channel};
 use io;
 use iter::Iterator;
+use kinds::Send;
 use mem::drop;
 use option::{Some, None};
 use result::{Ok, Err};
@@ -63,25 +64,23 @@ pub enum Signum {
 ///
 /// # Example
 ///
-/// ```rust,ignore
+/// ```rust,no_run
+/// # #![allow(unused_must_use)]
 /// use std::io::signal::{Listener, Interrupt};
 ///
 /// let mut listener = Listener::new();
 /// listener.register(Interrupt);
 ///
-/// spawn({
-///     loop {
-///         match listener.rx.recv() {
-///             Interrupt => println!("Got Interrupt'ed"),
-///             _ => (),
-///         }
+/// loop {
+///     match listener.rx.recv() {
+///         Interrupt => println!("Got Interrupt'ed"),
+///         _ => (),
 ///     }
-/// });
-///
+/// }
 /// ```
 pub struct Listener {
     /// A map from signums to handles to keep the handles in memory
-    handles: ~[(Signum, ~RtioSignal)],
+    handles: ~[(Signum, ~RtioSignal:Send)],
     /// This is where all the handles send signums, which are received by
     /// the clients from the receiver.
     tx: Sender<Signum>,