Add concurrent caller location test
This commit is contained in:
parent
c4ccd0b6a1
commit
fbe7fbb890
17
tests/run-pass/concurrency/concurrent_caller_location.rs
Normal file
17
tests/run-pass/concurrency/concurrent_caller_location.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use std::thread::spawn;
|
||||
use std::panic::Location;
|
||||
|
||||
fn initialize() {
|
||||
let _ignore = initialize_inner();
|
||||
}
|
||||
|
||||
fn initialize_inner() -> &'static Location<'static> {
|
||||
Location::caller()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let j1 = spawn(initialize);
|
||||
let j2 = spawn(initialize);
|
||||
j1.join().unwrap();
|
||||
j2.join().unwrap();
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
Loading…
Reference in New Issue
Block a user