Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks.

This commit is contained in:
bunnei 2015-01-18 13:25:51 -05:00
parent 6deb1a0119
commit e5a9f1c644
9 changed files with 63 additions and 122 deletions

View file

@ -26,7 +26,7 @@ public:
Handle lock_thread; ///< Handle to thread that currently has mutex
std::string name; ///< Name of mutex (optional)
ResultVal<bool> Wait(bool wait_thread) override;
ResultVal<bool> Wait() override;
ResultVal<bool> Acquire() override;
};
@ -156,12 +156,7 @@ Handle CreateMutex(bool initial_locked, const std::string& name) {
return handle;
}
ResultVal<bool> Mutex::Wait(bool wait_thread) {
if (locked && wait_thread) {
AddWaitingThread(GetCurrentThread());
Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_MUTEX, this);
}
ResultVal<bool> Mutex::Wait() {
return MakeResult<bool>(locked);
}