mesosphere: Skeleton K(Readable/Writable)Event

This commit is contained in:
Michael Scire
2018-11-05 03:51:50 -08:00
parent 600afa5f0f
commit a4419dfc41
7 changed files with 191 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#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->is_signaled;
}
Result KReadableEvent::Signal() {
KScopedCriticalSection critical_section;
if (!this->is_signaled) {
this->is_signaled = true;
this->NotifyWaiters();
}
return ResultSuccess();
}
Result KReadableEvent::Clear() {
this->Reset();
return ResultSuccess();
}
Result KReadableEvent::Reset() {
KScopedCriticalSection critical_section;
if (this->is_signaled) {
this->is_signaled = false;
return ResultSuccess();
}
return ResultKernelInvalidState();
}
}