Skip to content

Commit 851e745

Browse files
committed
Adding atomics mapping paragraph
1 parent daed96b commit 851e745

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/concurrency.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ fn main() {
127127
}
128128
```
129129

130+
r[concurrency.atomics.mapping]
131+
The following table lists the atomic types and the corresponding primitive types they represent:
132+
133+
| Primitive Type | Atomic Type |
134+
| -------------- | ------------------------------------- |
135+
| `bool` | [`core::sync::atomic::AtomicBool`] |
136+
| `i8` | [`core::sync::atomic::AtomicI8`] |
137+
| `i16` | [`core::sync::atomic::AtomicI16`] |
138+
| `i32` | [`core::sync::atomic::AtomicI32`] |
139+
| `i64` | [`core::sync::atomic::AtomicI64`] |
140+
| `isize` | [`core::sync::atomic::AtomicIsize`] |
141+
| `u8` | [`core::sync::atomic::AtomicU8`] |
142+
| `u16` | [`core::sync::atomic::AtomicU16`] |
143+
| `u32` | [`core::sync::atomic::AtomicU32`] |
144+
| `u64` | [`core::sync::atomic::AtomicU64`] |
145+
| `usize` | [`core::sync::atomic::AtomicUsize`] |
146+
| `*mut T` | [`core::sync::atomic::AtomicPtr<T>`] |
147+
130148
[concurrent programs]: glossary.md#concurrent-program
131149
[data races]: glossary.md#data-race
132150
[`Send`]: special-types-and-traits.md#send
@@ -136,3 +154,15 @@ fn main() {
136154
[marker traits]: glossary.md#marker-trait
137155
[`core::future::Future`]: https://doc.rust-lang.org/stable/core/future/trait.Future.html
138156
[Atomic types]: glossary.md#atomic-types
157+
[`core::sync::atomic::AtomicBool`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html
158+
[`core::sync::atomic::AtomicI8`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI8.html
159+
[`core::sync::atomic::AtomicI16`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI16.html
160+
[`core::sync::atomic::AtomicI32`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI32.html
161+
[`core::sync::atomic::AtomicI64`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI64.html
162+
[`core::sync::atomic::AtomicIsize`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicIsize.html
163+
[`core::sync::atomic::AtomicU8`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU8.html
164+
[`core::sync::atomic::AtomicU16`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU16.html
165+
[`core::sync::atomic::AtomicU32`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html
166+
[`core::sync::atomic::AtomicU64`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU64.html
167+
[`core::sync::atomic::AtomicUsize`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html
168+
[`core::sync::atomic::AtomicPtr<T>`]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicPtr.html

0 commit comments

Comments
 (0)