Fix infinite loop in Arc::downgrade
This commit is contained in:
parent
f92ce2e9fe
commit
af047d9c10
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue