rust/src/libstd/sync
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
..
mpsc Remove another invalid example 2015-04-07 21:46:14 +02:00
barrier.rs Remove explicit syntax highlight from docs. 2015-03-13 19:25:18 -04:00
condvar.rs Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
future.rs Remove Thunk struct and Invoke trait; change Thunk to be an alias 2015-04-01 14:41:21 -04:00
mod.rs Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
mutex.rs Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
once.rs Remove explicit syntax highlight from docs. 2015-03-13 19:25:18 -04:00
rwlock.rs Implement reentrant mutexes and make stdio use them 2015-04-08 19:42:16 +03:00
semaphore.rs Mass rename uint/int to usize/isize 2015-03-26 12:10:22 -07:00