rust/src
Alex Crichton 697de42f69 rollup merge of #23087: nagisa/std-undeadlock
Being a person who somehow has taken a liking to premature optimisation, my knee-jerk reaction to
locking in std handles was preamble resembling following snippet:

    let stdout = stdout();
    let lstdout = stdout.lock();
    let stdin = stdin();
    let lstdin = stdin.lock();

and then reading from the locked handle like this:

    let mut letter = [0; 1];
    lstdin.read(&mut letter).unwrap();

As it is now this code will deadlock because the `read` method attempts to lock stdout as well!

r? @alexcrichton

---

Either way, I find flushing stdout when stdin is used debatable. I believe people who write prompts should take care to flush stdout when necessary themselves.

Another idea: Would be cool if locks on std handles would be taken for a thread, rather than a handle, so given preamble (first code snippet)

    stdin.lock()

or more generally

    stdin.read(…)

worked fine. I.e. if more than a single lock are all taken inside the same thread, it would work, though not sure if our synchronisation primitives are expressive enough to make it possible.
2015-03-06 15:37:47 -08:00
..
compiler-rt@58ab642c30
compiletest rollup merge of #22975: alexcrichton/stabilize-ffi 2015-03-06 15:37:14 -08:00
doc Rollup merge of #23048 - davbo:fix-broken-link-in-old-guide, r=brson 2015-03-06 22:22:32 +05:30
driver
etc Rollup merge of #23000 - Florob:unicode-FL, r=brson 2015-03-05 12:37:48 +05:30
grammar
jemalloc@e24a1a025a bumping again to get the updated configure 2015-03-05 12:38:35 +05:30
liballoc Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libarena Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libbacktrace
libcollections Rollup merge of #23067 - oli-obk:doc_examle_fix, r=alexcrichton 2015-03-06 22:22:34 +05:30
libcore Rollup merge of #23100 - wesleywiser:fix_23059, r=brson 2015-03-06 22:22:38 +05:30
libcoretest Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libflate Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libfmt_macros fix for new attributes failing. issue #22964 2015-03-05 11:53:51 -05:00
libgetopts Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libgraphviz Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
liblibc Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
liblog Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librand Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librbml Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc rollup merge of #22975: alexcrichton/stabilize-ffi 2015-03-06 15:37:14 -08:00
librustc_back Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_bitflags Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_borrowck Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_driver rollup merge of #22975: alexcrichton/stabilize-ffi 2015-03-06 15:37:14 -08:00
librustc_lint Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_llvm Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_privacy Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_resolve Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustc_trans rollup merge of #22975: alexcrichton/stabilize-ffi 2015-03-06 15:37:14 -08:00
librustc_typeck Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
librustdoc rollup merge of #22975: alexcrichton/stabilize-ffi 2015-03-06 15:37:14 -08:00
libserialize Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libstd rollup merge of #23087: nagisa/std-undeadlock 2015-03-06 15:37:47 -08:00
libsyntax Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libterm Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libtest Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
libunicode Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
llvm@bff6907697 updating llvm submodule to include bitrig support 2015-03-05 12:38:34 +05:30
rt
rust-installer@60fd8abfca
rustbook std: Stabilize the fs module 2015-03-05 16:49:41 -08:00
rustllvm updating llvm-auto-clean-trigger too 2015-03-05 12:38:35 +05:30
test Rollup merge of #23025 - huonw:better-iter-infer, r=Gankro 2015-03-06 22:22:31 +05:30
snapshots.txt adding bitrig snapshot to snapshots file 2015-03-05 12:38:35 +05:30