Skip to content

Commit af047d9

Browse files
committed
Fix infinite loop in Arc::downgrade
1 parent f92ce2e commit af047d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/liballoc/arc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ impl<T: ?Sized> Arc<T> {
263263
loop {
264264
// check if the weak counter is currently "locked"; if so, spin.
265265
if cur == usize::MAX {
266+
cur = this.inner().weak.load(Relaxed);
266267
continue;
267268
}
268269

0 commit comments

Comments
 (0)