diff options
author | Tony Wasserka <neobrainx@gmail.com> | 2015-01-30 15:00:17 +0100 |
---|---|---|
committer | Tony Wasserka <neobrainx@gmail.com> | 2015-01-30 15:00:17 +0100 |
commit | 28702cbfeb1fe21109f8b1efa189785594319b78 (patch) | |
tree | 64e4b1ec43b7699fe1a6ab1be1c688b6d63c0d75 /src/core/hle/kernel/event.h | |
parent | Merge pull request #412 from purpasmart96/svc_table_cleanup (diff) | |
parent | Kernel: Mark all appropriate kernel objects as "final" (diff) | |
download | yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.gz yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.bz2 yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.lz yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.xz yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.tar.zst yuzu-28702cbfeb1fe21109f8b1efa189785594319b78.zip |
Diffstat (limited to 'src/core/hle/kernel/event.h')
-rw-r--r-- | src/core/hle/kernel/event.h | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h index c08b12ee1..2c3e6b14e 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/event.h @@ -11,26 +11,35 @@ namespace Kernel { -/** - * Signals an event - * @param handle Handle to event to signal - * @return Result of operation, 0 on success, otherwise error code - */ -ResultCode SignalEvent(const Handle handle); - -/** - * Clears an event - * @param handle Handle to event to clear - * @return Result of operation, 0 on success, otherwise error code - */ -ResultCode ClearEvent(Handle handle); - -/** - * Creates an event - * @param reset_type ResetType describing how to create event - * @param name Optional name of event - * @return Handle to newly created Event object - */ -Handle CreateEvent(const ResetType reset_type, const std::string& name="Unknown"); +class Event final : public WaitObject { +public: + /** + * Creates an event + * @param reset_type ResetType describing how to create event + * @param name Optional name of event + */ + static ResultVal<SharedPtr<Event>> Create(ResetType reset_type, std::string name = "Unknown"); + + std::string GetTypeName() const override { return "Event"; } + std::string GetName() const override { return name; } + + static const HandleType HANDLE_TYPE = HandleType::Event; + HandleType GetHandleType() const override { return HANDLE_TYPE; } + + ResetType intitial_reset_type; ///< ResetType specified at Event initialization + ResetType reset_type; ///< Current ResetType + + bool signaled; ///< Whether the event has already been signaled + std::string name; ///< Name of event (optional) + + bool ShouldWait() override; + void Acquire() override; + + void Signal(); + void Clear(); + +private: + Event() = default; +}; } // namespace |