From 6a8dedcd4976cb83c82c5f224bdcd5fd1f1e4ff9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 26 May 2015 09:05:43 +0200 Subject: [PATCH] Add 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 e682eae5ed..17a53072bb 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -1121,6 +1121,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 1421c109f8..ca22ea07cc 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -534,6 +534,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 4566b13f1d..e98483782e 100644 --- a/modules/juce_core/threads/juce_ChildProcess.cpp +++ b/modules/juce_core/threads/juce_ChildProcess.cpp @@ -81,6 +81,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 0adcb57b70..7a1c88c3eb 100644 --- a/modules/juce_core/threads/juce_ChildProcess.h +++ b/modules/juce_core/threads/juce_ChildProcess.h @@ -106,6 +106,8 @@ public: */ bool kill(); + uint32 getPID() const noexcept; + private: //============================================================================== class ActiveProcess;