Rollup merge of #87507 - jethrogb:jb/sgx-unmoveable-mutex, r=dtolnay

SGX mutex is *not* moveable

Reverts the erroneous change in #85029.
This commit is contained in:
Yuki Okushi 2021-07-28 18:28:20 +09:00 committed by GitHub
commit 8bc7ec1316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,8 @@ pub struct Mutex {
inner: SpinMutex<WaitVariable<bool>>,
}
pub type MovableMutex = Mutex;
// not movable: see UnsafeList implementation
pub type MovableMutex = Box<Mutex>;
// Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28
impl Mutex {

View File

@ -23,6 +23,7 @@ impl<T> UnsafeListEntry<T> {
}
}
// WARNING: self-referential struct!
pub struct UnsafeList<T> {
head_tail: NonNull<UnsafeListEntry<T>>,
head_tail_entry: Option<UnsafeListEntry<T>>,