diff options
| author | Stefan Boberg <[email protected]> | 2021-09-29 23:03:22 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-29 23:03:22 +0200 |
| commit | 2f0be8be02aaa48d02a864473cb318441f2d17cd (patch) | |
| tree | e15696f664d42b1716ee04aeade147b0ce816403 | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-2f0be8be02aaa48d02a864473cb318441f2d17cd.tar.xz zen-2f0be8be02aaa48d02a864473cb318441f2d17cd.zip | |
thread: Marked some members noexcept and [[nodiscard]]
| -rw-r--r-- | zencore/include/zencore/thread.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/zencore/include/zencore/thread.h b/zencore/include/zencore/thread.h index 7889682cd..410ffbd1e 100644 --- a/zencore/include/zencore/thread.h +++ b/zencore/include/zencore/thread.h @@ -75,12 +75,12 @@ public: ZENCORE_API Event(); ZENCORE_API ~Event(); - Event(Event&& Rhs) : m_EventHandle(Rhs.m_EventHandle) { Rhs.m_EventHandle = nullptr; } + Event(Event&& Rhs) noexcept : m_EventHandle(Rhs.m_EventHandle) { Rhs.m_EventHandle = nullptr; } Event(const Event& Rhs) = delete; Event& operator=(const Event& Rhs) = delete; - inline Event& operator=(Event&& Rhs) + inline Event& operator=(Event&& Rhs) noexcept { std::swap(m_EventHandle, Rhs.m_EventHandle); return *this; @@ -133,14 +133,14 @@ public: ZENCORE_API ~ProcessHandle(); - ZENCORE_API void Initialize(int Pid); - ZENCORE_API void Initialize(void* ProcessHandle); /// Initialize with an existing handle - takes ownership of the handle - ZENCORE_API bool IsRunning() const; - ZENCORE_API bool IsValid() const; - ZENCORE_API bool Wait(int TimeoutMs = -1); - ZENCORE_API void Terminate(int ExitCode); - ZENCORE_API void Reset(); - inline int Pid() const { return m_Pid; } + ZENCORE_API void Initialize(int Pid); + ZENCORE_API void Initialize(void* ProcessHandle); /// Initialize with an existing handle - takes ownership of the handle + ZENCORE_API [[nodiscard]] bool IsRunning() const; + ZENCORE_API [[nodiscard]] bool IsValid() const; + ZENCORE_API bool Wait(int TimeoutMs = -1); + ZENCORE_API void Terminate(int ExitCode); + ZENCORE_API void Reset(); + inline [[nodiscard]] int Pid() const { return m_Pid; } private: void* m_ProcessHandle = nullptr; |