summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/writable_event.h
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-27 15:18:29 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-29 14:48:40 +0100
commita342bcc9b130e9bd78720e09e04c92dcac8840d0 (patch)
treedf1d16c2a71b121fc449b53fc931c6fac8ccf82a /src/core/hle/kernel/writable_event.h
parentcore: Port all current usages of Event to Readable/WritableEvent (diff)
downloadyuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.gz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.bz2
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.lz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.xz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.zst
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.zip
Diffstat (limited to 'src/core/hle/kernel/writable_event.h')
-rw-r--r--src/core/hle/kernel/writable_event.h36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/core/hle/kernel/writable_event.h b/src/core/hle/kernel/writable_event.h
index c0fe42302..4357d1b9f 100644
--- a/src/core/hle/kernel/writable_event.h
+++ b/src/core/hle/kernel/writable_event.h
@@ -12,8 +12,14 @@ namespace Kernel {
class KernelCore;
class ReadableEvent;
+class WritableEvent;
-class WritableEvent final : public WaitObject {
+struct EventPair {
+ SharedPtr<ReadableEvent> readable;
+ SharedPtr<WritableEvent> writable;
+};
+
+class WritableEvent final : public Object {
public:
~WritableEvent() override;
@@ -23,18 +29,8 @@ public:
* @param reset_type ResetType describing how to create event
* @param name Optional name of event
*/
- 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);
+ static EventPair CreateEventPair(KernelCore& kernel, ResetType reset_type,
+ std::string name = "Unknown");
std::string GetTypeName() const override {
return "WritableEvent";
@@ -48,27 +44,17 @@ public:
return HANDLE_TYPE;
}
- ResetType GetResetType() const {
- return reset_type;
- }
-
- bool ShouldWait(Thread* thread) const override;
- void Acquire(Thread* thread) override;
-
- void WakeupAllWaitingThreads() override;
+ ResetType GetResetType() const;
void Signal();
void Clear();
- void ResetOnAcquire();
- void ResetOnWakeup();
bool IsSignaled() const;
private:
explicit WritableEvent(KernelCore& kernel);
- ResetType reset_type; ///< Current ResetType
+ SharedPtr<ReadableEvent> readable;
- bool signaled; ///< Whether the event has already been signaled
std::string name; ///< Name of event (optional)
};