commit | 11e700bcbebceff3752a34849a39a360d0af4322 | [log] [tgz] |
---|---|---|
author | Vincent Pelletier <plr.vincent@gmail.com> | Sat Jan 11 10:24:20 2025 |
committer | Vincent Pelletier <plr.vincent@gmail.com> | Sat Jan 11 10:30:40 2025 |
tree | 265acab685e15b59c1f7c1fc99d1ac5d23f128d6 | |
parent | bc572fe63c3e0d0933a04dd0a9e374b1a83b0985 [diff] |
usb1: Make finalizer registration thread-safe itertools.count.__next__ is not thread-safe. Wrapping it in a lock call seems the simplest approach. Make counter an instance attribute rather than a class attribute, to reduce the risk of lock contention at the expense of a slight increase in memory use.