Always align Waiter to 4 bytes
This commit is contained in:
parent
c11a44ab6c
commit
c2bbfeadcc
1 changed files with 1 additions and 0 deletions
|
|
@ -171,6 +171,7 @@ const STATE_MASK: usize = 0x3;
|
|||
// `wait` would both hand out a mutable reference to its `Waiter` node, and keep
|
||||
// a shared reference to check `signaled`. Instead we hold shared references and
|
||||
// use interior mutability.
|
||||
#[repr(align(4))] // Ensure the two lower bits are free to use as state bits.
|
||||
struct Waiter {
|
||||
thread: Cell<Option<Thread>>,
|
||||
signaled: AtomicBool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue