Fix infinite loop in Arc::downgrade
This commit is contained in:
@@ -263,6 +263,7 @@ impl<T: ?Sized> Arc<T> {
|
|||||||
loop {
|
loop {
|
||||||
// check if the weak counter is currently "locked"; if so, spin.
|
// check if the weak counter is currently "locked"; if so, spin.
|
||||||
if cur == usize::MAX {
|
if cur == usize::MAX {
|
||||||
|
cur = this.inner().weak.load(Relaxed);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user