diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-10-13 15:29:38 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-10-13 15:29:38 +0200 |
| commit | b26aa5d97353bed9ace56d8f247c88b2f9d4f8fd (patch) | |
| tree | 3697c77ac5b9856a1e2c89eb2e86e9436d43db61 /library/std/src/sys | |
| parent | f1c3edbfaba6dd1723fcd63857f7de5ef2278f57 (diff) | |
| download | rust-b26aa5d97353bed9ace56d8f247c88b2f9d4f8fd.tar.gz rust-b26aa5d97353bed9ace56d8f247c88b2f9d4f8fd.zip | |
Add note about using cells in the locks on the 'unsupported' platform.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unsupported/mutex.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/rwlock.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/sys/unsupported/mutex.rs b/library/std/src/sys/unsupported/mutex.rs index 3b97d0875bd..7830faae601 100644 --- a/library/std/src/sys/unsupported/mutex.rs +++ b/library/std/src/sys/unsupported/mutex.rs @@ -1,6 +1,7 @@ use crate::cell::Cell; pub struct Mutex { + // This platform has no threads, so we can use a Cell here. locked: Cell<bool>, } diff --git a/library/std/src/sys/unsupported/rwlock.rs b/library/std/src/sys/unsupported/rwlock.rs index 9aaba8bff11..6982b2b155f 100644 --- a/library/std/src/sys/unsupported/rwlock.rs +++ b/library/std/src/sys/unsupported/rwlock.rs @@ -1,6 +1,7 @@ use crate::cell::Cell; pub struct RWLock { + // This platform has no threads, so we can use a Cell here. mode: Cell<isize>, } |
