We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b631ca0 commit efd305eCopy full SHA for efd305e
library/std/src/sys/windows/compat.rs
@@ -214,11 +214,8 @@ pub(super) fn load_synch_functions() {
214
Some(())
215
}
216
217
- // Shortcut if we've already tried (and failed) to load the library.
+ // Try to load the module but skip loading if a previous attempt failed.
218
static LOAD_MODULE: AtomicBool = AtomicBool::new(true);
219
- if LOAD_MODULE.load(Ordering::Acquire) {
220
- if try_load().is_none() {
221
- LOAD_MODULE.store(false, Ordering::Release);
222
- }
223
+ let module_loaded = LOAD_MODULE.load(Ordering::Acquire) && try_load().is_some();
+ LOAD_MODULE.store(module_loaded, Ordering::Release)
224
0 commit comments