We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c11a44a commit c2bbfeaCopy full SHA for c2bbfea
src/libstd/sync/once.rs
@@ -171,6 +171,7 @@ const STATE_MASK: usize = 0x3;
171
// `wait` would both hand out a mutable reference to its `Waiter` node, and keep
172
// a shared reference to check `signaled`. Instead we hold shared references and
173
// use interior mutability.
174
+#[repr(align(4))] // Ensure the two lower bits are free to use as state bits.
175
struct Waiter {
176
thread: Cell<Option<Thread>>,
177
signaled: AtomicBool,
0 commit comments