Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.

This commit is contained in:
bunnei 2015-01-20 18:16:45 -05:00
parent c68eb15695
commit 15b6a4d9ad
9 changed files with 42 additions and 71 deletions

View file

@ -22,12 +22,12 @@
namespace Kernel {
ResultVal<bool> Thread::ShouldWait() {
return MakeResult<bool>(status != THREADSTATUS_DORMANT);
bool Thread::ShouldWait() {
return status != THREADSTATUS_DORMANT;
}
ResultVal<bool> Thread::Acquire() {
return MakeResult<bool>(true);
void Thread::Acquire() {
_assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
}
// Lists all thread ids that aren't deleted/etc.
@ -269,9 +269,7 @@ void Thread::ReleaseWaitObject(WaitObject* wait_object) {
// Iterate through all waiting objects to check availability...
for (auto itr = wait_objects.begin(); itr != wait_objects.end(); ++itr) {
auto res = (*itr)->ShouldWait();
if (*res && res.Succeeded())
if ((*itr)->ShouldWait())
wait_all_failed = true;
// The output should be the last index of wait_object