Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #84684

Merged
merged 26 commits into from
Apr 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
264442c
Don't rebuild rustdoc after checking bootstrap
jyn514 Apr 23, 2021
e8a143a
Ignore commented out lines when finding features
syvb Apr 24, 2021
79020a8
`test tidy` should ignore alternative `build` dir patterns
richkadel Apr 24, 2021
43309f9
Build sanitizers for x86_64-unknown-linux-musl
12101111 Apr 25, 2021
9e722f7
Set `backtrace-on-ice` by default for compiler and codegen profiles
jyn514 Apr 25, 2021
a7e23f4
Add starting anchor
syvb Apr 25, 2021
1c8e122
Switch `rustc::internal` from deny to warn
jyn514 Apr 27, 2021
eb753e8
Add a regression test for #75883
JohnTitor Apr 28, 2021
de92dfb
Add a regression test for #80779
JohnTitor Apr 28, 2021
8b806bc
Remove extra word in `rustc_mir` docs
pierwill Apr 28, 2021
1ac6326
Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` i…
CDirkx Apr 28, 2021
153eb72
rustdoc: change aliases attribute to data-aliases
notriddle Apr 27, 2021
b57049a
rustdoc: update auto_aliases test case with data-aliases attribute
notriddle Apr 27, 2021
8dc09e1
Update books
ehuss Apr 28, 2021
b28754a
Add `x.py check src/librustdoc` as an alias for `x.py check src/tools…
jyn514 Apr 26, 2021
43afe76
Rollup merge of #84484 - jyn514:check-tools, r=Mark-Simulacrum
jackh726 Apr 29, 2021
dbfe0e9
Rollup merge of #84530 - richkadel:test-tidy-build-dirs, r=Mark-Simul…
jackh726 Apr 29, 2021
4da8c22
Rollup merge of #84531 - Smittyvb:foo-not-feature, r=Mark-Simulacrum
jackh726 Apr 29, 2021
e803622
Rollup merge of #84540 - 12101111:enable-sanitizers, r=Mark-Simulacrum
jackh726 Apr 29, 2021
87b2ace
Rollup merge of #84555 - jyn514:ice-backtrace, r=Mark-Simulacrum
jackh726 Apr 29, 2021
e6dce23
Rollup merge of #84585 - jyn514:check-rustdoc, r=Mark-Simulacrum
jackh726 Apr 29, 2021
4306806
Rollup merge of #84636 - notriddle:data-aliases, r=jyn514,GuillaumeGomez
jackh726 Apr 29, 2021
96c2316
Rollup merge of #84646 - JohnTitor:add-some-bad-placeholder-tests, r=…
jackh726 Apr 29, 2021
0963754
Rollup merge of #84661 - pierwill:patch-1, r=jackh726
jackh726 Apr 29, 2021
ccd04a5
Rollup merge of #84663 - CDirkx:dropguard, r=Mark-Simulacrum
jackh726 Apr 29, 2021
5d2ac6f
Rollup merge of #84668 - ehuss:update-books, r=ehuss
jackh726 Apr 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove DropGuard in sys::windows::process and use StaticMutex i…
…nstead
CDirkx committed Apr 28, 2021
commit 1ac632627b7fc172887d0b8395cb8c8997c72274
28 changes: 4 additions & 24 deletions library/std/src/sys/windows/process.rs
Original file line number Diff line number Diff line change
@@ -19,9 +19,9 @@ use crate::sys::c;
use crate::sys::cvt;
use crate::sys::fs::{File, OpenOptions};
use crate::sys::handle::Handle;
use crate::sys::mutex::Mutex;
use crate::sys::pipe::{self, AnonPipe};
use crate::sys::stdio;
use crate::sys_common::mutex::StaticMutex;
use crate::sys_common::process::{CommandEnv, CommandEnvs};
use crate::sys_common::AsInner;

@@ -94,10 +94,6 @@ pub struct StdioPipes {
pub stderr: Option<AnonPipe>,
}

struct DropGuard<'a> {
lock: &'a Mutex,
}

impl Command {
pub fn new(program: &OsStr) -> Command {
Command {
@@ -209,8 +205,9 @@ impl Command {
//
// For more information, msdn also has an article about this race:
// http://support.microsoft.com/kb/315939
static CREATE_PROCESS_LOCK: Mutex = Mutex::new();
let _guard = DropGuard::new(&CREATE_PROCESS_LOCK);
static CREATE_PROCESS_LOCK: StaticMutex = StaticMutex::new();

let _guard = unsafe { CREATE_PROCESS_LOCK.lock() };

let mut pipes = StdioPipes { stdin: None, stdout: None, stderr: None };
let null = Stdio::Null;
@@ -259,23 +256,6 @@ impl fmt::Debug for Command {
}
}

impl<'a> DropGuard<'a> {
fn new(lock: &'a Mutex) -> DropGuard<'a> {
unsafe {
lock.lock();
DropGuard { lock }
}
}
}

impl<'a> Drop for DropGuard<'a> {
fn drop(&mut self) {
unsafe {
self.lock.unlock();
}
}
}

impl Stdio {
fn to_handle(&self, stdio_id: c::DWORD, pipe: &mut Option<AnonPipe>) -> io::Result<Handle> {
match *self {