mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
libstratosphere: add ReadOnlySystemEvent helper
This commit is contained in:
parent
9b1a2451b0
commit
6538554485
2 changed files with 10 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue