JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::sync::ipc::process_launcher< Path, IsBinary >::handle Struct Referencefinal

Process handle representing a single launched instance. More...

#include <jh/synchronous/ipc/process_launcher.h>

Public Member Functions

 handle (const handle &)=delete
handle & operator= (const handle &)=delete
 handle (handle &&other) noexcept
handle & operator= (handle &&other) noexcept
 ~handle ()
 Destructor enforces std::thread-like semantics.
void wait ()
 Wait for the launched process to finish.

Friends

class process_launcher

Detailed Description

template<jh::meta::TStr Path, bool IsBinary = true>
struct jh::sync::ipc::process_launcher< Path, IsBinary >::handle

Process handle representing a single launched instance.

Semantics

  • Must be explicitly wait()-ed before destruction.
  • If destroyed while still active, the program terminates.
  • Non-copyable, but movable with strict rules:
    • Move transfers exclusive ownership.
    • The source becomes invalid and cannot be reused or waited.
    • Assigning into an active handle triggers std::terminate().
  • These rules mirror std::thread semantics and ensure safe, deterministic process lifetime management.

Security binding

  • This handle type is tightly bound to its process_launcher<Path, IsBinary> template.
  • Each launcher produces a unique handle type tied to a specific compile-time verified executable path.
  • This prevents handle hijacking, cross-launcher misuse, and runtime path injection attacks.

Constructor & Destructor Documentation

◆ ~handle()

template<jh::meta::TStr Path, bool IsBinary = true>
jh::sync::ipc::process_launcher< Path, IsBinary >::handle::~handle ( )
inline

Destructor enforces std::thread-like semantics.

  • If wait() has not been called, the program is terminated.
  • Otherwise, underlying OS handles are released safely.

Member Function Documentation

◆ wait()

template<jh::meta::TStr Path, bool IsBinary = true>
void jh::sync::ipc::process_launcher< Path, IsBinary >::handle::wait ( )
inline

Wait for the launched process to finish.

Blocks until the child process terminates. Multiple calls are idempotent.


The documentation for this struct was generated from the following file: