Skip to content

Commit 277255e

Browse files
committed
Auto merge of rust-lang#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.
2 parents c1b5bb2 + e8db686 commit 277255e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dlmalloc = { version = "0.2.1", features = ['rustc-dep-of-std'] }
4242
fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
4343

4444
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies]
45-
hermit-abi = { version = "0.1.17", features = ['rustc-dep-of-std'] }
45+
hermit-abi = { version = "0.1.19", features = ['rustc-dep-of-std'] }
4646

4747
[target.wasm32-wasi.dependencies]
4848
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }

std/src/sys/hermit/condvar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct Condvar {
1414
sem2: *const c_void,
1515
}
1616

17-
pub type MovableCondvar = Box<Condvar>;
17+
pub type MovableCondvar = Condvar;
1818

1919
unsafe impl Send for Condvar {}
2020
unsafe impl Sync for Condvar {}

std/src/sys/hermit/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub struct Mutex {
156156
inner: Spinlock<MutexInner>,
157157
}
158158

159-
pub type MovableMutex = Box<Mutex>;
159+
pub type MovableMutex = Mutex;
160160

161161
unsafe impl Send for Mutex {}
162162
unsafe impl Sync for Mutex {}

std/src/sys/hermit/rwlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct RWLock {
88
state: UnsafeCell<State>,
99
}
1010

11-
pub type MovableRWLock = Box<RWLock>;
11+
pub type MovableRWLock = RWLock;
1212

1313
enum State {
1414
Unlocked,

0 commit comments

Comments
 (0)