Explorar o código

* Threadhost property for easy access to thread host class

Michael Van Canneyt hai 5 meses
pai
achega
a4ffb0957d
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      packages/wasi/src/wasiworkerthreadhost.pas

+ 8 - 0
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