mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
Add concurrent caller location test
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user