MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / drop

Method drop

atomic-repository/src/repository/locks.rs:124–142  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

122
123impl Drop for AdvisoryFileLock {
124 fn drop(&mut self) {
125 let release = HELD_LOCKS.with(|held| {
126 let mut held = held.borrow_mut();
127 match held.get_mut(&self.path) {
128 Some((count, _, _)) if *count > 1 => {
129 *count -= 1;
130 false
131 }
132 Some(_) => {
133 held.remove(&self.path);
134 true
135 }
136 None => false,
137 }
138 });
139 if release {
140 let _ = FileExt::unlock(&*self.file);
141 }
142 }
143}
144
145#[derive(Clone, Copy)]

Callers

nothing calls this directly

Calls 2

get_mutMethod · 0.80
removeMethod · 0.65

Tested by

no test coverage detected