aboutsummaryrefslogtreecommitdiff
path: root/zencore/thread.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-08-06 15:10:01 +0200
committerStefan Boberg <[email protected]>2021-08-06 15:10:01 +0200
commite45ee6a2133e3f4c2cb5b3c53341de5e1ce1d20f (patch)
tree376dbf5641ee50477aa8ff75e628a13eb8be12c8 /zencore/thread.cpp
parentAdded GetRunningExecutablePath() (diff)
downloadzen-e45ee6a2133e3f4c2cb5b3c53341de5e1ce1d20f.tar.xz
zen-e45ee6a2133e3f4c2cb5b3c53341de5e1ce1d20f.zip
zen::Process -> zen::ProcessHandle
Diffstat (limited to 'zencore/thread.cpp')
-rw-r--r--zencore/thread.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index 5e558069b..5cbb6999d 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -139,17 +139,17 @@ NamedMutex::Exists(std::string_view MutexName)
return true;
}
-Process::Process() = default;
+ProcessHandle::ProcessHandle() = default;
void
-Process::Initialize(void* ProcessHandle)
+ProcessHandle::Initialize(void* ProcessHandle)
{
ZEN_ASSERT(m_ProcessHandle == nullptr);
// TODO: perform some debug verification here to verify it's a valid handle?
m_ProcessHandle = ProcessHandle;
}
-Process::~Process()
+ProcessHandle::~ProcessHandle()
{
if (IsValid())
{
@@ -159,7 +159,7 @@ Process::~Process()
}
void
-Process::Initialize(int Pid)
+ProcessHandle::Initialize(int Pid)
{
ZEN_ASSERT(m_ProcessHandle == nullptr);
m_ProcessHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, Pid);
@@ -167,7 +167,7 @@ Process::Initialize(int Pid)
}
bool
-Process::IsRunning() const
+ProcessHandle::IsRunning() const
{
DWORD ExitCode = 0;
GetExitCodeProcess(m_ProcessHandle, &ExitCode);
@@ -176,13 +176,13 @@ Process::IsRunning() const
}
bool
-Process::IsValid() const
+ProcessHandle::IsValid() const
{
return (m_ProcessHandle != nullptr) && (m_ProcessHandle != INVALID_HANDLE_VALUE);
}
void
-Process::Terminate(int ExitCode)
+ProcessHandle::Terminate(int ExitCode)
{
if (IsRunning())
{
@@ -198,7 +198,7 @@ Process::Terminate(int ExitCode)
}
bool
-Process::Wait(int TimeoutMs)
+ProcessHandle::Wait(int TimeoutMs)
{
const DWORD Timeout = (TimeoutMs < 0) ? INFINITE : TimeoutMs;