Skip to content

Commit

Permalink
fix: Add more emphasis to the anti-deadlock comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lajp committed Jul 31, 2023
1 parent b85ff44 commit a012a06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vahti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ impl Torimies {

let ihs = self.itemhistorystorage.clone();

// pre-populate ItemHistoryStorage to prevent deadlocks on inserts
// NOTE: pre-populate ItemHistoryStorage to prevent deadlocks on inserts
// this must not be done concurrently and must be done while there are
// no references (mutable or unmutable) into the ihs dashmap
vahtis.iter().for_each(|v| {
if !ihs.contains_key(&(v.user_id as u64, v.delivery_method)) {
ihs.insert(
Expand Down

0 comments on commit a012a06

Please sign in to comment.