From ba16864865dbbb3f69783d210b4f07f599906a73 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 27 Aug 2024 17:07:11 +0200 Subject: zenserver process launch/termination improvements (#138) * zenserver process launch/termination improvements * fix GetPidStatus to return error code on Linux * fix linux FindProcess() * cleanup IsZombieProcess --- src/zencore/include/zencore/process.h | 1 + src/zencore/include/zencore/thread.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/zencore/include') diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h index 48a2eb0d7..d1394cd9a 100644 --- a/src/zencore/include/zencore/process.h +++ b/src/zencore/include/zencore/process.h @@ -27,6 +27,7 @@ public: ZENCORE_API [[nodiscard]] bool IsRunning() const; ZENCORE_API [[nodiscard]] bool IsValid() const; ZENCORE_API bool Wait(int TimeoutMs = -1); + ZENCORE_API bool Wait(int TimeoutMs, std::error_code& OutEc); ZENCORE_API int WaitExitCode(); ZENCORE_API int GetExitCode(); ZENCORE_API bool Terminate(int ExitCode); diff --git a/src/zencore/include/zencore/thread.h b/src/zencore/include/zencore/thread.h index 9362802a1..8fb781571 100644 --- a/src/zencore/include/zencore/thread.h +++ b/src/zencore/include/zencore/thread.h @@ -138,8 +138,8 @@ public: ZENCORE_API explicit NamedEvent(std::string_view EventName); ZENCORE_API ~NamedEvent(); ZENCORE_API void Close(); - ZENCORE_API void Set(); - ZENCORE_API bool Wait(int TimeoutMs = -1); + ZENCORE_API std::error_code Set(); + ZENCORE_API bool Wait(int TimeoutMs = -1); NamedEvent(NamedEvent&& Rhs) noexcept : m_EventHandle(Rhs.m_EventHandle) { Rhs.m_EventHandle = nullptr; } -- cgit v1.2.3