1 //@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
2 //@ignore-target-windows: No libc on Windows
11 // Access the environment in another thread without taking the env lock
12 let k = CString::new("MIRI_ENV_VAR_TEST".as_bytes()).unwrap();
13 let s = libc::getenv(k.as_ptr()) as *const libc::c_char;
17 let _s = String::from_utf8_lossy(CStr::from_ptr(s).to_bytes());
20 // After the main thread exits, env vars will be cleaned up -- but because we have not *joined*
21 // the other thread, those accesses technically race with those in the other thread.