Table of Contents

Class ProcessWatchdog

Namespace
RDCore.SDK.Server
Assembly
RDCore.SDK.dll

A last-resort guard that hard-terminates the current process if a clean shutdown does not finish unwinding in time — for example, a non-cooperative background thread or finalizer from a third-party library keeping the process alive after Main has returned.

public static class ProcessWatchdog
Inheritance
ProcessWatchdog
Inherited Members

Methods

Arm(int, int)

Arms a background thread that calls Exit(int) with exitCode after graceSeconds seconds. A process that unwinds cleanly first races ahead of it and the thread is torn down with the process, so this only ever fires when something is genuinely wedged. Arm it once the shutdown sequence is underway.

public static void Arm(int exitCode, int graceSeconds = 10)

Parameters

exitCode int

The exit code to terminate with if the watchdog fires.

graceSeconds int

Seconds to wait for a clean exit before terminating (minimum 1).