Getting a Delphi TTimer to work with a multi-threading app
I have an issue with a simple TTimer that's initiated and have its OnTimer event executed in the main app thread , the code looks like this: procedure TForm1.DoSomeStuff(); begin OmniLock.Acquire; try Parallel.Pipeline.NumTasks(MaxThreads).Stage(StageProc).Run; if (MyTimer = nil) then begin MyTimer := TTimer.Create(nil); MyTimer.Interval := 60 * 1000; // timer fired every 60 seconds MyTimer.OnTimer := MyTimerEvent; MyTimer.Enabled := True; end; finally OmniLock.Release; end; // try/finally end; Everthing work just fine when I execute the code in a simple project/demo, but in my app (which uses