The lambda passed to with_thread_if_needed helper function relies on moving its captured parameters, so it's made mutable in order to avoid copying.
The lambda passed to with_thread_if_needed helper function relies on moving its captured parameters, so it's made mutable in order to avoid copying.