Use load_construct_data for kernel objects

This commit is contained in:
Hamish Milne
2019-12-27 18:52:33 +00:00
committed by zhupengfei
parent 3ed8d95866
commit 6917eaf53b
35 changed files with 158 additions and 113 deletions

View File

@ -27,12 +27,11 @@ void ReleaseThreadMutexes(Thread* thread) {
thread->held_mutexes.clear();
}
Mutex::Mutex() : kernel(Core::Global<KernelSystem>()) {}
Mutex::Mutex(KernelSystem& kernel) : WaitObject(kernel), kernel(kernel) {}
Mutex::~Mutex() {}
std::shared_ptr<Mutex> KernelSystem::CreateMutex(bool initial_locked, std::string name) {
auto mutex{std::make_shared<Mutex>()};
mutex->Init(*this);
auto mutex{std::make_shared<Mutex>(*this)};
mutex->lock_count = 0;
mutex->name = std::move(name);