rust/src/libstd
Alex Crichton 0393a1602f rollup merge of #20650: klutzy/omg-windows-error-mode
Believe or not, `CreateProcess()` is racy if several threads create
child processes: [0], [1], [2].

This caused some tests show crash dialogs during
`make check-stage#-rpass`.

More explanation:

On Windows, `SetErrorMode()` controls display of error dialogs: it
accepts new error mode and returns old error mode.
The error mode is process-global and automatically inherited to child
process when created.

MSYS2 bash shell internally sets it to not show error dialogs, therefore
`make check-stage#-rpass` should not show them either.

However, [1] says that `CreateProcess()` internally invokes
`SetErrorMode()` twice: at first it sets mode `0x8001` and saves
original mode, and at second it restores original mode.
So if two threads simultaneously call `CreateProcess()`, the first
thread sets error mode to `0x8001` then the second thread recognizes
that current error mode is `0x8001`. Therefore, The second thread will
create process with wrong error mode.

This really occurs inside `compiletest`: it creates several processes on
each thread, so some `run-pass` tests are invoked with wrong error mode
therefore show crash dialog.

This commit adds `StaticMutex` for `CreateProcess()` call. This seems
to fix the "dialog annoyance" issue.

[0]: http://support.microsoft.com/kb/315939
[1]: https://code.google.com/p/nativeclient/issues/detail?id=2968
[2]: https://ghc.haskell.org/trac/ghc/ticket/2650
2015-01-06 15:38:56 -08:00
..
collections rollup merge of #20607: nrc/kinds 2015-01-06 15:34:10 -08:00
ffi
io rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
num markers -> marker 2015-01-07 12:10:31 +13:00
path rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
prelude rollup merge of #20607: nrc/kinds 2015-01-06 15:34:10 -08:00
rand rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
rt rollup merge of #20607: nrc/kinds 2015-01-06 15:34:10 -08:00
sync rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
sys rollup merge of #20650: klutzy/omg-windows-error-mode 2015-01-06 15:38:56 -08:00
thread_local rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
time Register new snapshots 2015-01-06 15:24:24 -08:00
ascii.rs
bitflags.rs
bool.rs
dynamic_lib.rs
error.rs Stabilize std::error 2015-01-06 09:20:40 -08:00
failure.rs Replace full slice notation with index calls 2015-01-07 10:46:33 +13:00
fmt.rs core: split into fmt::Show and fmt::String 2015-01-06 14:49:42 -08:00
hash.rs markers -> marker 2015-01-07 12:10:31 +13:00
lib.rs rollup merge of #20607: nrc/kinds 2015-01-06 15:34:10 -08:00
macros.rs rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
os.rs rollup merge of #20607: nrc/kinds 2015-01-06 15:34:10 -08:00
rtdeps.rs
thread.rs rollup merge of #20615: aturon/stab-2-thread 2015-01-06 15:38:38 -08:00
thunk.rs markers -> marker 2015-01-07 12:10:31 +13:00
tuple.rs
unit.rs