tor-persist API bug hazards
The tor-persist API leaves open the possibilities of writing code which (i) fails to call try_lock
or (ii) having called try_lock
, makes simultaneous updates from multiple threads/locations which are semantically incoherent due to races.
Probably: try_lock
should return a lock guard. store
should only be availabe on &mut guard
.
(Filing this because I wrote bug (i) and this was only detected by a failing test.)