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 13 pull requests #74205

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fb9fa5b
adjust ub-enum test to be endianess-independent
RalfJung Jul 3, 2020
bcef848
Explain effects of debugging options from config.toml
tmiasko Jul 5, 2020
6b59cac
Suppress debuginfo on naked function arguments
npmccallum Jul 6, 2020
5702e02
Only allow `repr(i128/u128)` on enum
nbdd0121 Jul 6, 2020
97867bb
Add UI test for issue 74082
nbdd0121 Jul 6, 2020
b50c13c
Update books
ehuss Jul 7, 2020
32025fd
Update rust-installer to latest version
michaelforney May 25, 2020
653c091
Add `read_exact_at` and `write_all_at` to WASI's `FileExt`
sunfishcode Jul 3, 2020
58fc61b
Make WASI's FileExt's read_at/write_at consistent with other targets.
sunfishcode Jul 7, 2020
3c63fba
Correctly mark the ending span of a match arm
ayazhafiz Jul 7, 2020
59f979f
Fix cross-compilation of LLVM to aarch64 Windows targets
arlosi Jul 2, 2020
51b646e
ci: disabled: riscv: minimise docker overlays
tblah Jul 8, 2020
d9fec59
ci: fix context for disabled docker images
tblah Jul 8, 2020
7fb421b
linker: illumos ld does not support --eh-frame-hdr
jclulow Jul 8, 2020
6864546
Add a help to use `in_band_lifetimes` in nightly
JohnTitor Jul 8, 2020
a9b6476
Tweak wording
JohnTitor Jul 9, 2020
0a7d297
Eliminate `rust_input`.
nnethercote Jul 7, 2020
1e8ec2d
Add an explanatory comment to `scoped_thread`.
nnethercote Jul 7, 2020
4ad5de2
Tweak `spawn_thread_pool`.
nnethercote Jul 7, 2020
059d6cf
Change some function names.
nnethercote Jul 7, 2020
25d31e9
Rollup merge of #73989 - RalfJung:ub-enum-test, r=oli-obk
Manishearth Jul 10, 2020
bc3db83
Rollup merge of #74045 - tmiasko:config-debug, r=nikomatsakis
Manishearth Jul 10, 2020
a316f51
Rollup merge of #74076 - sunfishcode:wasi-fileext-newmethods, r=alexc…
Manishearth Jul 10, 2020
86b2224
Rollup merge of #74105 - npmccallum:naked, r=matthewjasper
Manishearth Jul 10, 2020
5fa4d01
Rollup merge of #74109 - nbdd0121:issue-74082, r=petrochenkov
Manishearth Jul 10, 2020
c7ab962
Rollup merge of #74116 - arlosi:aarch64build, r=pietroalbini
Manishearth Jul 10, 2020
7ad0e69
Rollup merge of #74122 - nnethercote:startup-cleanup, r=petrochenkov
Manishearth Jul 10, 2020
82fa122
Rollup merge of #74125 - ayazhafiz:i/74050, r=matthewjasper
Manishearth Jul 10, 2020
9db22e6
Rollup merge of #74135 - ehuss:update-books, r=ehuss
Manishearth Jul 10, 2020
4476eb3
Rollup merge of #74145 - michaelforney:rust-installer, r=Mark-Simulacrum
Manishearth Jul 10, 2020
8821c49
Rollup merge of #74161 - tblah:riscv64gc-dockerfile-improvment, r=Mar…
Manishearth Jul 10, 2020
fdb5f7c
Rollup merge of #74167 - jclulow:illumos-linker-eh-frame-hdr-fix, r=p…
Manishearth Jul 10, 2020
e84c903
Rollup merge of #74168 - JohnTitor:help-for-in-band-lifetimes, r=petr…
Manishearth Jul 10, 2020
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
Tweak spawn_thread_pool.
This makes the two versions (parallel and non-parallel) more similar to
each other.
  • Loading branch information
nnethercote committed Jul 10, 2020
commit 4ad5de22d182578e846a6ccc69940e76a820381c
23 changes: 12 additions & 11 deletions src/librustc_interface/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(

crate::callbacks::setup_callbacks();

scoped_thread(cfg, || {
let main_handler = move || {
rustc_ast::with_session_globals(edition, || {
ty::tls::GCX_PTR.set(&Lock::new(0), || {
if let Some(stderr) = stderr {
Expand All @@ -151,7 +151,9 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
f()
})
})
})
};

scoped_thread(cfg, main_handler)
}

#[cfg(parallel_compiler)]
Expand All @@ -161,12 +163,9 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
stderr: &Option<Arc<Mutex<Vec<u8>>>>,
f: F,
) -> R {
use rayon::{ThreadBuilder, ThreadPool, ThreadPoolBuilder};

let gcx_ptr = &Lock::new(0);
crate::callbacks::setup_callbacks();

let mut config = ThreadPoolBuilder::new()
let mut config = rayon::ThreadPoolBuilder::new()
.thread_name(|_| "rustc".to_string())
.acquire_thread_handler(jobserver::acquire_thread)
.release_thread_handler(jobserver::release_thread)
Expand All @@ -177,7 +176,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
config = config.stack_size(size);
}

let with_pool = move |pool: &ThreadPool| pool.install(move || f());
let with_pool = move |pool: &rayon::ThreadPool| pool.install(move || f());

rustc_ast::with_session_globals(edition, || {
rustc_ast::SESSION_GLOBALS.with(|ast_session_globals| {
Expand All @@ -190,10 +189,12 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
let main_handler = move |thread: ThreadBuilder| {
rustc_ast::SESSION_GLOBALS.set(ast_session_globals, || {
rustc_span::SESSION_GLOBALS.set(span_session_globals, || {
if let Some(stderr) = stderr {
io::set_panic(Some(box Sink(stderr.clone())));
}
ty::tls::GCX_PTR.set(gcx_ptr, || thread.run())
ty::tls::GCX_PTR.set(&Lock::new(0), || {
if let Some(stderr) = stderr {
io::set_panic(Some(box Sink(stderr.clone())));
}
thread.run()
})
})
})
};
Expand Down