mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 00:27:52 +01:00
Fix deadlock
This commit is contained in:
@@ -172,7 +172,7 @@ int AddressSpace::unmap(void *virt) {
|
||||
}
|
||||
FDT *AddressSpace::getFdt() {
|
||||
if (_fdt.get() == nullptr) {
|
||||
LockGuard l(_lock);
|
||||
LockGuard l(_fdtLock);
|
||||
if (_fdt.get() == nullptr) {
|
||||
_fdt = UniquePtr(new FDT());
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ private:
|
||||
uint64_t *PML4;
|
||||
|
||||
UniquePtr<FDT> _fdt;
|
||||
Mutex _fdtLock;
|
||||
|
||||
UniquePtr<cgistd::vector<uint64_t *>> _taken_pages;
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ bool Mutex::try_lock() {
|
||||
//}
|
||||
|
||||
void Mutex::lock() {
|
||||
assert((owner() != Scheduler::cur_task() || !locked));
|
||||
|
||||
bool spinned = false;
|
||||
|
||||
if (Mutex::try_lock()) {
|
||||
|
||||
Reference in New Issue
Block a user