Auto merge of #88002 - hermitcore:unbox-mutex, r=dtolnay

Unbox mutexes, condvars and rwlocks on hermit

[RustyHermit](https://github.com/hermitcore/rusty-hermit) provides now movable synchronization primitives and we are able to unbox mutexes and condvars.
This commit is contained in:
bors 2021-08-19 09:08:11 +00:00
commit a9ab2e5539
5 changed files with 6 additions and 6 deletions

View File

@ -1529,9 +1529,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
version = "0.1.17"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"compiler_builtins",
"libc",

View File

@ -42,7 +42,7 @@ dlmalloc = { version = "0.2.1", features = ['rustc-dep-of-std'] }
fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies]
hermit-abi = { version = "0.1.17", features = ['rustc-dep-of-std'] }
hermit-abi = { version = "0.1.19", features = ['rustc-dep-of-std'] }
[target.wasm32-wasi.dependencies]
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }

View File

@ -14,7 +14,7 @@ pub struct Condvar {
sem2: *const c_void,
}
pub type MovableCondvar = Box<Condvar>;
pub type MovableCondvar = Condvar;
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}

View File

@ -156,7 +156,7 @@ pub struct Mutex {
inner: Spinlock<MutexInner>,
}
pub type MovableMutex = Box<Mutex>;
pub type MovableMutex = Mutex;
unsafe impl Send for Mutex {}
unsafe impl Sync for Mutex {}

View File

@ -8,7 +8,7 @@ pub struct RWLock {
state: UnsafeCell<State>,
}
pub type MovableRWLock = Box<RWLock>;
pub type MovableRWLock = RWLock;
enum State {
Unlocked,