golf
This commit is contained in:
@@ -391,12 +391,12 @@ mod tls {
|
|||||||
/// lazily by the runtime if users do not perform it eagerly.
|
/// lazily by the runtime if users do not perform it eagerly.
|
||||||
pub fn initialize() -> Result<(), Trap> {
|
pub fn initialize() -> Result<(), Trap> {
|
||||||
PTR.with(|p| {
|
PTR.with(|p| {
|
||||||
let (state, mut initialized) = p.get();
|
let (state, initialized) = p.get();
|
||||||
if !initialized {
|
if initialized {
|
||||||
super::super::sys::lazy_per_thread_init()?;
|
return Ok(());
|
||||||
initialized = true;
|
|
||||||
}
|
}
|
||||||
p.set((state, initialized));
|
super::super::sys::lazy_per_thread_init()?;
|
||||||
|
p.set((state, true));
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user