diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/writable_event.h (renamed from src/core/hle/kernel/event.h) | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/writable_event.h index 27d6126b0..c0fe42302 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/writable_event.h @@ -11,20 +11,33 @@ namespace Kernel { class KernelCore; +class ReadableEvent; -class Event final : public WaitObject { +class WritableEvent final : public WaitObject { public: + ~WritableEvent() override; + /** * Creates an event * @param kernel The kernel instance to create this event under. * @param reset_type ResetType describing how to create event * @param name Optional name of event */ - static SharedPtr<Event> Create(KernelCore& kernel, ResetType reset_type, - std::string name = "Unknown"); + static std::tuple<SharedPtr<WritableEvent>, SharedPtr<ReadableEvent>> CreateEventPair( + KernelCore& kernel, ResetType reset_type, std::string name = "Unknown"); + + /** + * Creates an event and registers it in the kernel's named event table + * @param kernel The kernel instance to create this event under. + * @param reset_type ResetType describing how to create event + * @param name name of event + */ + static SharedPtr<WritableEvent> CreateRegisteredEventPair(KernelCore& kernel, + ResetType reset_type, + std::string name); std::string GetTypeName() const override { - return "Event"; + return "WritableEvent"; } std::string GetName() const override { return name; @@ -46,10 +59,12 @@ public: void Signal(); void Clear(); + void ResetOnAcquire(); + void ResetOnWakeup(); + bool IsSignaled() const; private: - explicit Event(KernelCore& kernel); - ~Event() override; + explicit WritableEvent(KernelCore& kernel); ResetType reset_type; ///< Current ResetType |