rust/src/libstd/io
Corey Richardson a6ce402401 rollup merge of #19416: sfackler/global-stdin
io::stdin returns a new `BufferedReader` each time it's called, which
results in some very confusing behavior with disappearing output. It now
returns a `StdinReader`, which wraps a global singleton
`Arc<Mutex<BufferedReader<StdReader>>`. `Reader` is implemented directly
on `StdinReader`. However, `Buffer` is not, as the `fill_buf` method is
fundamentaly un-thread safe. A `lock` method is defined on `StdinReader`
which returns a smart pointer wrapping the underlying `BufferedReader`
while guaranteeing mutual exclusion.

Code that treats the return value of io::stdin as implementing `Buffer`
will break. Add a call to `lock`:

```rust
io::stdin().read_line();
// =>
io::stdin().lock().read_line();
```

Closes #14434

[breaking-change]
2014-12-05 10:06:52 -08:00
..
net /*! -> //! 2014-11-26 16:50:14 -08:00
buffered.rs std: add Reader impl for &[u8] 2014-11-30 16:55:53 -08:00
comm_adapters.rs Fix fallout from coercion removal 2014-11-17 22:41:33 +13:00
extensions.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
fs.rs auto merge of #19303 : nodakai/rust/libsyntax-reject-dirs, r=alexcrichton 2014-12-05 00:22:58 +00:00
mem.rs rollup merge of #19364: steveklabnik/doc_buffered_reader 2014-12-05 10:06:42 -08:00
mod.rs Back io::stdin with a global singleton BufferedReader 2014-12-03 23:18:52 -08:00
pipe.rs sys: reveal std::io representation to sys module 2014-11-21 10:17:13 -08:00
process.rs Fallout from libgreen and libnative removal 2014-11-20 17:19:24 -08:00
result.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
stdio.rs Back io::stdin with a global singleton BufferedReader 2014-12-03 23:18:52 -08:00
tempfile.rs Rename unwrap functions to into_inner 2014-11-23 15:26:53 -08:00
test.rs /*! -> //! 2014-11-26 16:50:14 -08:00
timer.rs /*! -> //! 2014-11-26 16:50:14 -08:00
util.rs std: add Reader impl for &[u8] 2014-11-30 16:55:53 -08:00