GH #2689: Added tryWait() into Process and ProcessHandle. Handle kill()-ed UNIX process exit codes.

This commit is contained in:
Günter Obiltschnig
2020-01-22 08:23:36 +01:00
parent 5f0e0a0374
commit 924cdf235c
12 changed files with 187 additions and 95 deletions

View File

@@ -21,7 +21,7 @@
#include "Poco/Foundation.h"
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(_WIN32_WCE)
#include "Process_WINCE.h"
#else
@@ -66,6 +66,11 @@ public:
/// Waits for the process to terminate
/// and returns the exit code of the process.
int tryWait() const;
/// Checks that process is terminated
/// and returns the exit code of the process.
/// If the process is still running, returns -1.
protected:
ProcessHandle(ProcessHandleImpl* pImpl);
@@ -211,6 +216,10 @@ public:
/// Waits for the process specified by handle to terminate
/// and returns the exit code of the process.
static int tryWait(const ProcessHandle& handle);
/// Checks that process is finished and returns the exit code of the
/// process. If the process is still running, returns -1.
static bool isRunning(const ProcessHandle& handle);
/// check if the process specified by handle is running or not
///