mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 22:17:59 -05: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:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user