about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-08 19:03:09 +0000
committerbors <bors@rust-lang.org>2015-04-08 19:03:09 +0000
commitff804778c8d69d7835cf7076886ac5dac9a39659 (patch)
tree748fbd735552a72c5fe06d5025fbca206d688bc5 /src/libstd/sys/unix/stack_overflow.rs
parent30e7e6e8b0389d407f8b46ab605a9e3475a851d5 (diff)
parent45aa6c8d1bc2f7863c92da6643de4642bb2d83bf (diff)
downloadrust-ff804778c8d69d7835cf7076886ac5dac9a39659.tar.gz
rust-ff804778c8d69d7835cf7076886ac5dac9a39659.zip
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](https://github.com/rust-lang/rust/blob/80def6c2447d23a624e611417f24cf0ab2a5a676/src/libstd/io/stdio.rs#L267)).

Spotted on [reddit].

cc @alexcrichton 

[reddit]: http://www.reddit.com/r/rust/comments/31comh/println_with_multiple_threads/
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions