diff --git a/src/sessions.rs b/src/sessions.rs index f7728062..900fb3f0 100644 --- a/src/sessions.rs +++ b/src/sessions.rs @@ -364,6 +364,10 @@ fn ingest_from_pubsub(map: Arc>>) { }, None => {}, }; + + // Explicitly drop map write lock here (locks are automatically dropped + // when they fall out of scope but this is more clear.) + drop(mmap); continue } @@ -373,7 +377,8 @@ fn ingest_from_pubsub(map: Arc>>) { // Insert *mmap.entry(key).or_insert(expire_time) = expire_time; - // Get rid of writable reference to map. + // Get rid of writable reference to map. (locks are automatically dropped + // when they fall out of scope but this is more clear.) drop(mmap); debug!("Added registered ip {} from redis", sd);