mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-05 17:07:45 +02:00
* Started message
This commit is contained in:
parent
15d5b68de7
commit
254187c03c
@ -43,6 +43,7 @@ Const
|
||||
cmdLoaded = 'loaded';
|
||||
cmdKill = 'kill';
|
||||
cmdSpawn = 'spawn';
|
||||
cmdStarted = 'started';
|
||||
cmdLoad = 'load';
|
||||
cmdRun = 'run';
|
||||
cmdExecute = 'execute';
|
||||
@ -195,6 +196,7 @@ Type
|
||||
Module : TJSWebAssemblyModule;
|
||||
end;
|
||||
|
||||
|
||||
{ TWorkerLoadCommandHelper }
|
||||
|
||||
TWorkerLoadCommandHelper = class helper for TWorkerLoadCommand
|
||||
@ -202,6 +204,17 @@ Type
|
||||
Class function Create(aModule : TJSWebAssemblyModule; aMemory : TJSWebAssemblyMemory): TWorkerLoadCommand; static;reintroduce;
|
||||
end;
|
||||
|
||||
TWorkerStartedCommand = class external name 'Object' (TWorkerCommand)
|
||||
StartFunction : string;
|
||||
end;
|
||||
|
||||
{ TWorkerStartedCommandHelper }
|
||||
|
||||
TWorkerStartedCommandHelper = class helper for TWorkerStartedCommand
|
||||
Class function CommandName : string; static;
|
||||
Class function Create(aFunction : string): TWorkerStartedCommand; static;reintroduce;
|
||||
end;
|
||||
|
||||
|
||||
// Sent by main to worker: run thread procedure
|
||||
TWorkerRunCommand = class external name 'Object' (TWorkerCommand)
|
||||
@ -386,6 +399,19 @@ begin
|
||||
Result.Module:=aModule;
|
||||
end;
|
||||
|
||||
{ TWorkerStartedCommandHelper }
|
||||
|
||||
class function TWorkerStartedCommandHelper.CommandName: string;
|
||||
begin
|
||||
result:=cmdStarted;
|
||||
end;
|
||||
|
||||
class function TWorkerStartedCommandHelper.Create(aFunction: string): TWorkerStartedCommand;
|
||||
begin
|
||||
Result:=TWorkerStartedCommand(TWorkerCommand.NewWorker(CommandName));
|
||||
Result.StartFunction:=aFunction;
|
||||
end;
|
||||
|
||||
{ TWorkerSpawnThreadCommandHelper }
|
||||
|
||||
class function TWorkerSpawnThreadCommandHelper.CommandName: string;
|
||||
|
Loading…
Reference in New Issue
Block a user