diff options
author | bunnei <ericbunnie@gmail.com> | 2014-06-10 04:46:54 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-06-13 15:51:18 +0200 |
commit | 83a4ad28854f6c90f688e3d4523708c2d06267de (patch) | |
tree | 49154d88fe1e7f120ac25ef4f349f4c983105a9e | |
parent | HLE: Moved "PARAM" and "RETURN" macros to function_wrappers.h (this is only module where they are needed). (diff) | |
download | yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar.gz yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar.bz2 yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar.lz yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar.xz yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.tar.zst yuzu-83a4ad28854f6c90f688e3d4523708c2d06267de.zip |
-rw-r--r-- | src/core/hle/kernel/event.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 3a522c190..127c0cfc6 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -59,10 +59,8 @@ public: */ Result SetPermanentLock(Handle handle, const bool permanent_locked) { Event* evt = g_object_pool.GetFast<Event>(handle); - if (!evt) { - ERROR_LOG(KERNEL, "called with unknown handle=0x%08X", handle); - return -1; - } + _assert_msg_(KERNEL, (evt != nullptr), "called, but event is nullptr!"); + evt->permanent_locked = permanent_locked; return 0; } @@ -75,10 +73,8 @@ Result SetPermanentLock(Handle handle, const bool permanent_locked) { */ Result SetEventLocked(const Handle handle, const bool locked) { Event* evt = g_object_pool.GetFast<Event>(handle); - if (!evt) { - ERROR_LOG(KERNEL, "called with unknown handle=0x%08X", handle); - return -1; - } + _assert_msg_(KERNEL, (evt != nullptr), "called, but event is nullptr!"); + if (!evt->permanent_locked) { evt->locked = locked; } @@ -92,10 +88,8 @@ Result SetEventLocked(const Handle handle, const bool locked) { */ Result SignalEvent(const Handle handle) { Event* evt = g_object_pool.GetFast<Event>(handle); - if (!evt) { - ERROR_LOG(KERNEL, "called with unknown handle=0x%08X", handle); - return -1; - } + _assert_msg_(KERNEL, (evt != nullptr), "called, but event is nullptr!"); + // Resume threads waiting for event to signal bool event_caught = false; for (size_t i = 0; i < evt->waiting_threads.size(); ++i) { @@ -122,10 +116,8 @@ Result SignalEvent(const Handle handle) { */ Result ClearEvent(Handle handle) { Event* evt = g_object_pool.GetFast<Event>(handle); - if (!evt) { - ERROR_LOG(KERNEL, "called with unknown handle=0x%08X", handle); - return -1; - } + _assert_msg_(KERNEL, (evt != nullptr), "called, but event is nullptr!"); + if (!evt->permanent_locked) { evt->locked = true; } |