From b6b2fef0d05cecb32d4fdf7ed2593d18c6fd48cc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 19 Aug 2017 14:28:18 +0100 Subject: [PATCH] new ChildProcess::getPID() --- modules/juce_core/native/juce_posix_SharedCode.h | 5 +++++ modules/juce_core/native/juce_win32_Threads.cpp | 5 +++++ modules/juce_core/threads/juce_ChildProcess.cpp | 5 +++++ modules/juce_core/threads/juce_ChildProcess.h | 2 ++ 4 files changed, 17 insertions(+) diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index ea007b1f06..f6faa5bab9 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -1234,6 +1234,11 @@ public: return 0; } + int getPID() const noexcept + { + return childPID; + } + int childPID; private: diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp index 68d891f6d9..d38b733b84 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -488,6 +488,11 @@ public: return (uint32) exitCode; } + int getPID() const noexcept + { + return 0; + } + bool ok; private: diff --git a/modules/juce_core/threads/juce_ChildProcess.cpp b/modules/juce_core/threads/juce_ChildProcess.cpp index 5648c5d673..262882bb9a 100644 --- a/modules/juce_core/threads/juce_ChildProcess.cpp +++ b/modules/juce_core/threads/juce_ChildProcess.cpp @@ -75,6 +75,11 @@ String ChildProcess::readAllProcessOutput() return result.toString(); } +uint32 ChildProcess::getPID() const noexcept +{ + return activeProcess != nullptr ? activeProcess->getPID() : 0; +} + //============================================================================== #if JUCE_UNIT_TESTS diff --git a/modules/juce_core/threads/juce_ChildProcess.h b/modules/juce_core/threads/juce_ChildProcess.h index b2bd0e1b63..cbc380dfec 100644 --- a/modules/juce_core/threads/juce_ChildProcess.h +++ b/modules/juce_core/threads/juce_ChildProcess.h @@ -99,6 +99,8 @@ public: */ bool kill(); + uint32 getPID() const noexcept; + private: //============================================================================== class ActiveProcess;