rust/library/std/src/sys_common
bors 32cbc65e6b Auto merge of #77380 - fusion-engineering-forks:unbox-the-mutex, r=dtolnay
Unbox mutexes and condvars on some platforms

Both mutexes and condition variables contained a Box containing the actual os-specific object. This was done because moving these objects may cause undefined behaviour on some platforms.

However, this is not needed on Windows[1], Wasm[2], cloudabi[2], and 'unsupported'[3], were the box was only needlessly making them less efficient.

This change gets rid of the box on those platforms.

On those platforms, `Condvar` can no longer verify it is only used with one `Mutex`, as mutexes no longer have a stable address. This was addressed and considered acceptable in #76932.

[1]\: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initializesrwlock
[2]\: These are just a single atomic integer together with futex wait/wake calls/instructions.
[3]\: The `unsupported` platform doesn't support multiple threads at all.
2020-10-04 06:48:17 +00:00
..
bytestring std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
condvar Make it possible to have unboxed mutexes on specific platforms. 2020-10-02 09:47:08 +02:00
net std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
remutex std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread_local_key std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread_parker Move thread parker to sys_common. 2020-09-27 12:28:58 +02:00
wtf8 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
alloc.rs library/std/sys_common: Define MIN_ALIGN for sparc-unknown-linux-gnu 2020-09-28 00:39:57 +02:00
at_exit_imp.rs Split sys_common::Mutex in StaticMutex and MovableMutex. 2020-09-27 10:05:56 +02:00
backtrace.rs Prevent __rust_begin_short_backtrace frames from being tail-call optimised away 2020-08-07 19:31:25 +01:00
bytestring.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
condvar.rs Make it possible to have unboxed condvars on specific platforms. 2020-10-02 09:47:08 +02:00
fs.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
io.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
mod.rs Move thread parker to sys_common. 2020-09-27 12:28:58 +02:00
mutex.rs Make it possible to have unboxed mutexes on specific platforms. 2020-10-02 09:47:08 +02:00
net.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
os_str_bytes.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
poison.rs Move to Arc::clone(&x) over x.clone() in library/std 2020-08-30 21:59:43 +02:00
process.rs Add accessors to Command. 2020-09-26 18:58:38 -07:00
remutex.rs Remove workaround for deref issue that no longer exists. 2020-09-24 20:50:09 +02:00
rwlock.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
tests.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
thread_info.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
thread_local_dtor.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
thread_local_key.rs Split sys_common::Mutex in StaticMutex and MovableMutex. 2020-09-27 10:05:56 +02:00
util.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
wtf8.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00