1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-23 10:52:13 +00:00

libstratosphere: add ReadOnlySystemEvent helper

This commit is contained in:
Michael Scire 2018-11-07 23:20:48 -08:00
parent 9b1a2451b0
commit 6538554485
2 changed files with 10 additions and 5 deletions

View file

@ -125,3 +125,8 @@ template <bool a = false>
static IEvent *CreateWriteOnlySystemEvent() {
return CreateSystemEvent([](u64 timeout) { std::abort(); return 0; }, a);
}
template <class F>
static IEvent *LoadReadOnlySystemEvent(Handle r_h, F f, bool autoclear = false) {
return new HosEvent<F>(r_h, f, autoclear);
}

View file

@ -56,11 +56,6 @@ class HosMessageQueue {
bool TryPeek(uintptr_t *out);
bool TimedPeek(uintptr_t *out, u64 timeout);
private:
void SendInternal(uintptr_t data);
void SendNextInternal(uintptr_t data);
uintptr_t ReceiveInternal();
uintptr_t PeekInternal();
bool IsFull() {
return this->count >= this->capacity;
}
@ -68,6 +63,11 @@ class HosMessageQueue {
bool IsEmpty() {
return this->count == 0;
}
void SendInternal(uintptr_t data);
void SendNextInternal(uintptr_t data);
uintptr_t ReceiveInternal();
uintptr_t PeekInternal();
};