aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/thread.cpp')
-rw-r--r--src/zencore/thread.cpp13
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