about summary refs log tree commit diff
path: root/library/std/src/sys/solid
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-20 22:00:08 +0000
committerbors <bors@rust-lang.org>2022-09-20 22:00:08 +0000
commit7743aa836ee16d04831a34ee1ff109bf9d411277 (patch)
tree37b1a918c3034feb6186b8eae63822113da4ce53 /library/std/src/sys/solid
parent432abd86f231c908f6df3cdd779e83f35084be90 (diff)
parentbe09a4a8b2eadddadc0f3c00e40917e254ba91ab (diff)
downloadrust-7743aa836ee16d04831a34ee1ff109bf9d411277.tar.gz
rust-7743aa836ee16d04831a34ee1ff109bf9d411277.zip
Auto merge of #100581 - joboet:sync_rwlock_everywhere, r=thomcc
std: use `sync::RwLock` for internal statics

Since `sync::RwLock` is now `const`-constructible, it can be used for internal statics, removing the need for `sys_common::StaticRwLock`. This adds some extra allocations on platforms which need to box their locks (currently SGX and some UNIX), but these will become unnecessary with the lock improvements tracked in #93740.
Diffstat (limited to 'library/std/src/sys/solid')
-rw-r--r--library/std/src/sys/solid/os.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/solid/os.rs b/library/std/src/sys/solid/os.rs
index b5649d6e0ff..eecb347e599 100644
--- a/library/std/src/sys/solid/os.rs
+++ b/library/std/src/sys/solid/os.rs
@@ -8,7 +8,7 @@ use crate::os::{
     solid::ffi::{OsStrExt, OsStringExt},
 };
 use crate::path::{self, PathBuf};
-use crate::sys_common::rwlock::StaticRwLock;
+use crate::sync::RwLock;
 use crate::vec;
 
 use super::{error, itron, memchr};
@@ -78,7 +78,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
     unsupported()
 }
 
-static ENV_LOCK: StaticRwLock = StaticRwLock::new();
+static ENV_LOCK: RwLock<()> = RwLock::new(());
 
 pub struct Env {
     iter: vec::IntoIter<(OsString, OsString)>,