Lock during callbacks

This commit is contained in:
Lander Gallastegi 2025-06-14 19:33:05 +02:00
parent 90d8c8db74
commit d43d1bcbfe

View File

@ -130,19 +130,15 @@ public:
}
mask &= bits;
for (const auto& [start, end] : mask) {
func(cpu_addr + start * BYTES_PER_PAGE, (end - start) * BYTES_PER_PAGE);
}
if constexpr (clear) {
bits.UnsetRange(start_page, end_page);
if constexpr (type == Type::CPU) {
UpdateProtection<true>(std::move(lk));
} else {
lk.unlock();
}
} else {
lk.unlock();
}
for (const auto& [start, end] : mask) {
func(cpu_addr + start * BYTES_PER_PAGE, (end - start) * BYTES_PER_PAGE);
}
}