I'm writing a custom thread which includes some added functionality. The part I'm confused about is how to handle the `Execute` procedure, while still expecting it to be descended into more inherited implementations. 

My custom thread is overriding the `Execute` procedure and adding some of my own stuff, such as events `OnStart`, `OnStop` and `OnException`, as well as looping capabilities. I'm not sure how to design this in a way that expects it to be further used in a further inherited thread.

How do I make it possible to further inherit this custom thread while maintaining the `Execute` functionality?

Here's the execute procedure as I have overridden it...

```
procedure TJDThread.Execute;
begin
  Startup;
  try
    while not Terminated do begin
      if assigned(FOnExecute) then
        FOnExecute(Self);
      if not FRepeatExec then
        Terminate
      else
        if FExecDelay > 0 then
          Sleep(FExecDelay);
    end;
  finally
    Cleanup;
  end;
end;

```

I'm intending for `FOnExecute` to be actually an event of the thread, which is more-so a replacement of inheriting the `Execute` procedure - similar to how a service works. I don't think this is the right way to go... How do I make sure this is coded in a safe manner? I'm open to suggestions to another approach than an event - so long as it's aimed at the goal of making a custom `TThread` which can be inherited and further executed.

This custom thread I'm making includes some additional capabilities which don't come with the original `TThread` and yet will be extremely useful for many future projects. The additional capabilities are specifically `OnStart` and `OnStop` events (similar to how a service works), `CoInitialize` built in (and only used if told to, default = false), Repeated execution (default = false), and delay between executions (default = 0).