rust/library/std/src/sys_common
bors 15fc228d0d Auto merge of #97791 - m-ou-se:const-locks, r=m-ou-se
Make {Mutex, Condvar, RwLock}::new() const.

This makes it possible to have `static M: Mutex<_> = Mutex::new(..);` 🎉

Our implementations [on Linux](https://github.com/rust-lang/rust/pull/95035), [on Windows](https://github.com/rust-lang/rust/pull/77380), and various BSDs and some tier 3 platforms have already been using a non-allocating const-constructible implementation. As of https://github.com/rust-lang/rust/pull/97647, the remaining platforms (most notably macOS) now have a const-constructible implementation as well. This means we can finally make these functions publicly const.

Tracking issue: https://github.com/rust-lang/rust/issues/93740
2022-06-19 08:20:36 +00:00
..
condvar Lazily allocate+initialize locks. 2022-06-03 17:04:14 +02:00
memchr Move std::memchr to sys_common 2021-05-14 03:54:46 +02:00
net Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
remutex Fix more “a”/“an” typos 2021-08-22 16:35:29 +02:00
thread_local_key std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread_parker Don't use futexes on netbsd. 2022-05-03 12:26:17 +02:00
wtf8 Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
backtrace.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
condvar.rs Make all {Mutex, Condvar, RwLock}::new #[inline]. 2022-06-06 13:49:23 +02:00
fs.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
io.rs Avoid double panics when using TempDir in tests 2022-01-25 10:36:10 +00:00
lazy_box.rs Lazily allocate+initialize locks. 2022-06-03 17:04:14 +02:00
memchr.rs Move std::memchr to sys_common 2021-05-14 03:54:46 +02:00
mod.rs Lazily allocate+initialize locks. 2022-06-03 17:04:14 +02:00
mutex.rs Make {Mutex, Condvar, RwLock}::new() const. 2022-06-06 13:55:43 +02:00
net.rs Lower listen backlog to fix accept crashes 2022-06-13 20:44:56 -07:00
process.rs Remove CommandEnv::apply 2021-12-29 10:07:44 +01:00
remutex.rs Use Drop instead of destroy() for locks. 2022-06-03 16:45:47 +02:00
rwlock.rs Make {Mutex, Condvar, RwLock}::new() const. 2022-06-06 13:55:43 +02:00
tests.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread.rs Relax memory ordering used in min_stack 2022-05-01 15:55:54 -07:00
thread_info.rs Merge two THREAD_INFO.with and following RefCell borrow 2021-09-16 15:24:53 +02:00
thread_local_dtor.rs Remove "sys isn't exported yet" phrase 2022-05-30 12:07:43 +02:00
thread_local_key.rs Remove "sys isn't exported yet" phrase 2022-05-30 12:07:43 +02:00
wtf8.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00