Skip to content

Commit 8902ed0

Browse files
committed
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
2 parents 0deb16a + 137e648 commit 8902ed0

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/libstd/io/signal.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use clone::Clone;
2323
use comm::{Sender, Receiver, channel};
2424
use io;
2525
use iter::Iterator;
26+
use kinds::Send;
2627
use mem::drop;
2728
use option::{Some, None};
2829
use result::{Ok, Err};
@@ -63,25 +64,23 @@ pub enum Signum {
6364
///
6465
/// # Example
6566
///
66-
/// ```rust,ignore
67+
/// ```rust,no_run
68+
/// # #![allow(unused_must_use)]
6769
/// use std::io::signal::{Listener, Interrupt};
6870
///
6971
/// let mut listener = Listener::new();
7072
/// listener.register(Interrupt);
7173
///
72-
/// spawn({
73-
/// loop {
74-
/// match listener.rx.recv() {
75-
/// Interrupt => println!("Got Interrupt'ed"),
76-
/// _ => (),
77-
/// }
74+
/// loop {
75+
/// match listener.rx.recv() {
76+
/// Interrupt => println!("Got Interrupt'ed"),
77+
/// _ => (),
7878
/// }
79-
/// });
80-
///
79+
/// }
8180
/// ```
8281
pub struct Listener {
8382
/// A map from signums to handles to keep the handles in memory
84-
handles: ~[(Signum, ~RtioSignal)],
83+
handles: ~[(Signum, ~RtioSignal:Send)],
8584
/// This is where all the handles send signums, which are received by
8685
/// the clients from the receiver.
8786
tx: Sender<Signum>,

0 commit comments

Comments
 (0)