mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-12 11:17:49 +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
0a498c72d7
commit
b87b5e101a
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