Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/libstd/io/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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>,
Expand Down