| 199 | } |
| 200 | |
| 201 | fn atomic_enum_store(ident: &Ident) -> TokenStream2 { |
| 202 | quote! { |
| 203 | /// Stores a value into the atomic. |
| 204 | /// |
| 205 | /// `store` takes an `Ordering` argument which describes the memory ordering of this operation. Possible values are `SeqCst`, `Release` and `Relaxed`. |
| 206 | /// |
| 207 | /// # Panics |
| 208 | /// |
| 209 | /// Panics if order is `Acquire` or `AcqRel`. |
| 210 | pub fn store(&self, val: #ident, order: core::sync::atomic::Ordering) { |
| 211 | self.0.store(Self::to_usize(val), order) |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | #[cfg(feature = "cas")] |
| 217 | fn atomic_enum_swap(ident: &Ident) -> TokenStream2 { |