From e4bc1374be66665d63c755c66c64f5df365fd284 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 16 Sep 2021 14:02:24 +0200 Subject: Added some lawns to aid orientation within the file --- zencore/thread.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'zencore/thread.cpp') diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 598466bb4..620ea3bff 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -54,6 +54,8 @@ RwLock::ReleaseExclusive() #endif } +////////////////////////////////////////////////////////////////////////// + Event::Event() { m_EventHandle = CreateEvent(nullptr, true, false, nullptr); @@ -93,6 +95,8 @@ Event::Wait(int TimeoutMs) return (Result == WAIT_OBJECT_0); } +////////////////////////////////////////////////////////////////////////// + NamedEvent::NamedEvent(std::u8string_view EventName) : Event(nullptr) { using namespace std::literals; @@ -160,6 +164,8 @@ NamedMutex::Exists(std::string_view MutexName) return true; } +////////////////////////////////////////////////////////////////////////// + ProcessHandle::ProcessHandle() = default; void @@ -255,6 +261,8 @@ ProcessHandle::Wait(int TimeoutMs) return false; } +////////////////////////////////////////////////////////////////////////// + bool IsProcessRunning(int pid) { -- cgit v1.2.3 From 50d5945d66ff95a7f417270240c7b9077ca556d0 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 22 Sep 2021 21:12:09 +0200 Subject: Compile out Event methods on non-Windows platforms for now --- zencore/thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zencore/thread.cpp') diff --git a/zencore/thread.cpp b/zencore/thread.cpp index ded180337..30af79121 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -40,6 +40,8 @@ RwLock::ReleaseExclusive() ////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_WINDOWS + Event::Event() { m_EventHandle = CreateEvent(nullptr, true, false, nullptr); @@ -155,6 +157,8 @@ NamedMutex::Exists(std::string_view MutexName) return true; } +#endif // ZEN_PLATFORM_WINDOWS + ////////////////////////////////////////////////////////////////////////// ProcessHandle::ProcessHandle() = default; -- cgit v1.2.3 From 65e05a02dab8595a1576511e84d0f823d90ab809 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 22 Sep 2021 21:13:33 +0200 Subject: Compile out ProcessHandle's methods on non-Windows for now --- zencore/thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zencore/thread.cpp') diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 30af79121..5bae36b1e 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -159,6 +159,8 @@ NamedMutex::Exists(std::string_view MutexName) #endif // ZEN_PLATFORM_WINDOWS +#if ZEN_PLATFORM_WINDOWS + ////////////////////////////////////////////////////////////////////////// ProcessHandle::ProcessHandle() = default; @@ -258,6 +260,8 @@ ProcessHandle::Wait(int TimeoutMs) return false; } +#endif // ZEN_PLATFORM_WINDOWS + ////////////////////////////////////////////////////////////////////////// ProcessMonitor::ProcessMonitor() -- cgit v1.2.3 From 8df27293a17407985f0faa5b9c2cc508626037c7 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 22 Sep 2021 21:14:12 +0200 Subject: Compile out ProcessMonitor's methods on non-Windows for now --- zencore/thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zencore/thread.cpp') diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 5bae36b1e..748a0b146 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -264,6 +264,8 @@ ProcessHandle::Wait(int TimeoutMs) ////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_WINDOWS + ProcessMonitor::ProcessMonitor() { } @@ -327,6 +329,8 @@ ProcessMonitor::IsActive() const return m_ProcessHandles.empty() == false; } +#endif // ZEN_PLATFORM_WINDOWS + ////////////////////////////////////////////////////////////////////////// bool -- cgit v1.2.3