diff options
| author | Dan Engelbrecht <[email protected]> | 2024-08-27 17:07:11 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-08-27 17:07:11 +0200 |
| commit | ba16864865dbbb3f69783d210b4f07f599906a73 (patch) | |
| tree | 17efb792f14f5fc8df7831593ab4d764e6617193 /src/zencore/thread.cpp | |
| parent | Make sure `noexcept` functions does not leak exceptions (#136) (diff) | |
| download | zen-ba16864865dbbb3f69783d210b4f07f599906a73.tar.xz zen-ba16864865dbbb3f69783d210b4f07f599906a73.zip | |
zenserver process launch/termination improvements (#138)
* zenserver process launch/termination improvements
* fix GetPidStatus to return error code on Linux
* fix linux FindProcess()
* cleanup IsZombieProcess
Diffstat (limited to 'src/zencore/thread.cpp')
| -rw-r--r-- | src/zencore/thread.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp index 329e17eea..394197b8e 100644 --- a/src/zencore/thread.cpp +++ b/src/zencore/thread.cpp @@ -362,16 +362,23 @@ NamedEvent::Close() m_EventHandle = nullptr; } -void +std::error_code NamedEvent::Set() { ZEN_ASSERT(m_EventHandle != nullptr); #if ZEN_PLATFORM_WINDOWS - SetEvent(m_EventHandle); + if (!SetEvent(m_EventHandle)) + { + return MakeErrorCodeFromLastError(); + } #elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC int Sem = int(intptr_t(m_EventHandle) >> 32); - semctl(Sem, 0, SETVAL, 0); + if (semctl(Sem, 0, SETVAL, 0) == -1) + { + return MakeErrorCodeFromLastError(); + } #endif + return {}; } bool |