fix: check if new_ptr == end
, not the old pointer
This commit is contained in:
parent
53b95588df
commit
99339e940e
@ -107,10 +107,10 @@ impl<'d> Rng<'d> {
|
|||||||
.ptr
|
.ptr
|
||||||
.compare_exchange(ptr, new_ptr, Ordering::Relaxed, Ordering::Relaxed)
|
.compare_exchange(ptr, new_ptr, Ordering::Relaxed, Ordering::Relaxed)
|
||||||
{
|
{
|
||||||
Ok(ptr) => {
|
Ok(_) => {
|
||||||
let end = STATE.end.load(Ordering::Relaxed);
|
let end = STATE.end.load(Ordering::Relaxed);
|
||||||
// It doesn't matter if `end` was changed under our feet, because then this will just be false.
|
// It doesn't matter if `end` was changed under our feet, because then this will just be false.
|
||||||
if ptr == end {
|
if new_ptr == end {
|
||||||
STATE.waker.wake();
|
STATE.waker.wake();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user