Skip to content

Commit b26aa5d

Browse files
committed
Add note about using cells in the locks on the 'unsupported' platform.
1 parent f1c3edb commit b26aa5d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::cell::Cell;
22

33
pub struct Mutex {
4+
// This platform has no threads, so we can use a Cell here.
45
locked: Cell<bool>,
56
}
67

library/std/src/sys/unsupported/rwlock.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::cell::Cell;
22

33
pub struct RWLock {
4+
// This platform has no threads, so we can use a Cell here.
45
mode: Cell<isize>,
56
}
67

0 commit comments

Comments
 (0)