rust/src/libstd/sys
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
..
common Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
unix Auto merge of #24029 - nagisa:print-locking, r=alexcrichton 2015-04-08 19:03:09 +00:00
windows Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00