1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-14 07:56:45 +00:00
Atmosphere/mesosphere/source/processes/KReadableEvent.cpp

49 lines
846 B
C++
Raw Normal View History

#include <mesosphere/processes/KWritableEvent.hpp>
#include <mesosphere/processes/KReadableEvent.hpp>
#include <mesosphere/processes/KEvent.hpp>
#include <mesosphere/threading/KScheduler.hpp>
namespace mesosphere
{
bool KReadableEvent::IsSignaled() const
{
return this->isSignaled;
}
KReadableEvent::~KReadableEvent()
{
}
Result KReadableEvent::Signal()
{
KScopedCriticalSection criticalSection{};
if (!this->isSignaled) {
this->isSignaled = true;
NotifyWaiters();
}
2018-11-05 19:40:24 +00:00
return ResultSuccess();
}
Result KReadableEvent::Clear()
{
Reset();
2018-11-05 19:40:24 +00:00
return ResultSuccess();
}
Result KReadableEvent::Reset()
{
KScopedCriticalSection criticalSection{};
if (this->isSignaled) {
this->isSignaled = false;
2018-11-05 19:40:24 +00:00
return ResultSuccess();
}
2018-11-05 19:40:24 +00:00
return ResultKernelInvalidState();
}
}