Add new test_while_readonly helper function to run-make-support
This commit is contained in:
parent
7c2b3b5615
commit
03f19d632a
4 changed files with 52 additions and 25 deletions
|
@ -10,15 +10,16 @@ use std::sync::{Arc, Barrier};
|
|||
use std::thread;
|
||||
|
||||
fn main() {
|
||||
fs_wrapper::create_file("lib.rs");
|
||||
let barrier = Arc::new(Barrier::new(2));
|
||||
let handle = {
|
||||
let barrier = Arc::clone(&barrier);
|
||||
thread::spawn(move || {
|
||||
barrier.wait();
|
||||
rustc().crate_type("lib").arg("-Ztemps-dir=temp1").input("lib.rs");
|
||||
rustc().crate_type("lib").arg("-Ztemps-dir=temp1").input("lib.rs").run();
|
||||
})
|
||||
};
|
||||
barrier.wait();
|
||||
rustc().crate_type("staticlib").arg("-Ztemps-dir=temp2").input("lib.rs");
|
||||
rustc().crate_type("staticlib").arg("-Ztemps-dir=temp2").input("lib.rs").run();
|
||||
handle.join().expect("lib thread panicked");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue