From a4ffb0957dedd710a36ebdc6ae4a4616a45c630b Mon Sep 17 00:00:00 2001 From: Michael Van Canneyt Date: Mon, 24 Mar 2025 10:19:56 +0100 Subject: [PATCH] * Threadhost property for easy access to thread host class --- packages/wasi/src/wasiworkerthreadhost.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/wasi/src/wasiworkerthreadhost.pas b/packages/wasi/src/wasiworkerthreadhost.pas index 7487f49..7861bdb 100644 --- a/packages/wasi/src/wasiworkerthreadhost.pas +++ b/packages/wasi/src/wasiworkerthreadhost.pas @@ -190,6 +190,7 @@ Type TWorkerThreadControllerApplication = class(TWorkerWASIHostApplication) Private FThreadSupport : TThreadController; + function GetThreadHost: TWASIThreadControllerHost; Protected function CreateThreadSupport(aEnv: TPas2JSWASIEnvironment): TThreadController; virtual; procedure HandleConsoleWrite(Sender: TObject; aOutput: string); virtual; @@ -201,6 +202,8 @@ Type Public procedure ShowException(aError: Exception); override; property ThreadSupport : TThreadController Read FThreadSupport; + property ThreadHost : TWASIThreadControllerHost read GetThreadHost; + end; function GetJSClassName(aObj : TJSObject) : string; @@ -875,6 +878,11 @@ begin end; end; +function TWorkerThreadControllerApplication.GetThreadHost: TWASIThreadControllerHost; +begin + Result:=(Host as TWASIThreadControllerHost) +end; + function TWorkerThreadControllerApplication.CreateThreadSupport(aEnv : TPas2JSWASIEnvironment) : TThreadController; begin