mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 21:25:46 +00:00
kernel/readable_event: Add member function for enforcing a strict reset contract
svcResetSignal relies on the event instance to have already been signaled before attempting to reset it. If this isn't the case, then an error code has to be returned.
This commit is contained in:
parent
e5dd4cb392
commit
a3aa7aaf0b
2 changed files with 22 additions and 1 deletions
|
@ -4,10 +4,10 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/kernel/readable_event.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
#include "core/hle/kernel/writable_event.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -34,6 +34,16 @@ void ReadableEvent::Clear() {
|
|||
signaled = false;
|
||||
}
|
||||
|
||||
ResultCode ReadableEvent::Reset() {
|
||||
if (!signaled) {
|
||||
return ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
Clear();
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void ReadableEvent::WakeupAllWaitingThreads() {
|
||||
WaitObject::WakeupAllWaitingThreads();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue