rust/src/libstd/io
bors ff804778c8 Auto merge of #24029 - nagisa:print-locking, r=alexcrichton
write_fmt calls write for each formatted field. The default implementation of write_fmt is used,
which will call write on not-yet-locked stdout (and write locking after), therefore making print!
in multithreaded environment still interleave contents of two separate prints.

I’m not sure whether we want to do this change, though, because it has the same deadlock hazard which we tried to avoid by not locking inside write_fmt itself (see [this comment](80def6c244/src/libstd/io/stdio.rs (L267))).

Spotted on [reddit].

cc @alexcrichton 

[reddit]: http://www.reddit.com/r/rust/comments/31comh/println_with_multiple_threads/
2015-04-08 19:03:09 +00:00
..
buffered.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00
cursor.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00
error.rs std: Stabilize last bits of io::Error 2015-03-31 16:12:48 -07:00
impls.rs std: Stabilize last bits of io::Error 2015-03-31 16:12:48 -07:00
lazy.rs std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
mod.rs Remove outdated notice from BufRead::lines docs. 2015-04-06 08:40:11 -07:00
prelude.rs std: Update docs for removal of ReadExt, WriteExt 2015-03-24 22:20:35 +01:00
stdio.rs Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
util.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00