fix(kqueue): fix an unlocked snapshots usage
This commit is contained in:
parent
79eb81c816
commit
94e150a522
1 changed files with 4 additions and 1 deletions
|
|
@ -419,7 +419,10 @@ pub fn remove_watch(self: *@This(), allocator: std.mem.Allocator, path: []const
|
||||||
std.posix.close(entry.value);
|
std.posix.close(entry.value);
|
||||||
allocator.free(entry.key);
|
allocator.free(entry.key);
|
||||||
}
|
}
|
||||||
if (self.snapshots.fetchRemove(path)) |entry| {
|
self.snapshots_mutex.lock();
|
||||||
|
const snap_entry = self.snapshots.fetchRemove(path);
|
||||||
|
self.snapshots_mutex.unlock();
|
||||||
|
if (snap_entry) |entry| {
|
||||||
var names = entry.value;
|
var names = entry.value;
|
||||||
var it = names.iterator();
|
var it = names.iterator();
|
||||||
while (it.next()) |ne| {
|
while (it.next()) |ne| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue