Skip to content

Commit b518dc7

Browse files
author
Jethro Beekman
committed
Add warning to SGX mutex implementation
1 parent eb6f2d4 commit b518dc7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/std/src/sys/sgx/mutex.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub struct Mutex {
88
inner: SpinMutex<WaitVariable<bool>>,
99
}
1010

11+
// not movable: see UnsafeList implementation
1112
pub type MovableMutex = Box<Mutex>;
1213

1314
// Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28

library/std/src/sys/sgx/waitqueue/unsafe_list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ impl<T> UnsafeListEntry<T> {
2323
}
2424
}
2525

26+
// WARNING: self-referential struct!
2627
pub struct UnsafeList<T> {
2728
head_tail: NonNull<UnsafeListEntry<T>>,
2829
head_tail_entry: Option<UnsafeListEntry<T>>,

0 commit comments

Comments
 (0)