Merge pull request #4608 from wwylele/sharedmem-circular

Kernel/SharedMemory: make owner_process a raw pointer
master
Weiyi Wang 2019-02-25 10:32:45 +07:00 committed by GitHub
commit ad1cfc8d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

@ -407,6 +407,12 @@ Kernel::Process::Process(KernelSystem& kernel)
kernel.memory.RegisterPageTable(&vm_manager.page_table);
}
Kernel::Process::~Process() {
// Release all objects this process owns first so that their potential destructor can do clean
// up with this process before further destruction.
// TODO(wwylele): explicitly destroy or invalidate objects this process owns (threads, shared
// memory etc.) even if they are still referenced by other processes.
handle_table.Clear();
kernel.memory.UnregisterPageTable(&vm_manager.page_table);
}

@ -94,7 +94,7 @@ private:
/// Permission restrictions applied to other processes mapping the block.
MemoryPermission other_permissions{};
/// Process that created this shared memory block.
SharedPtr<Process> owner_process;
Process* owner_process;
/// Address of shared memory block in the owner process if specified.
VAddr base_address = 0;
/// Name of shared memory object.