diff options
Diffstat (limited to 'src/core/hle/kernel/event.cpp')
| -rw-r--r-- | src/core/hle/kernel/event.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 3e116e3df..23f9df0d6 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -22,23 +22,17 @@ SharedPtr<Event> Event::Create(ResetType reset_type, std::string name) { evt->reset_type = reset_type; evt->name = std::move(name); - if (reset_type == ResetType::Pulse) { - LOG_ERROR(Kernel, "Unimplemented event reset type Pulse"); - UNIMPLEMENTED(); - } - return evt; } -bool Event::ShouldWait() { +bool Event::ShouldWait(Thread* thread) const { return !signaled; } -void Event::Acquire() { - ASSERT_MSG(!ShouldWait(), "object unavailable!"); +void Event::Acquire(Thread* thread) { + ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); - // Release the event if it's not sticky... - if (reset_type != ResetType::Sticky) + if (reset_type == ResetType::OneShot) signaled = false; } @@ -51,4 +45,11 @@ void Event::Clear() { signaled = false; } +void Event::WakeupAllWaitingThreads() { + WaitObject::WakeupAllWaitingThreads(); + + if (reset_type == ResetType::Pulse) + signaled = false; +} + } // namespace |
