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 Omni Thread Library v3), the timer event is never fired
I'm pretty sure it's nothing, I just can't figure out what's wrong!
I triple checked: MyTimer
is only assigned once in my code, its OnTimer event is correctly assigned, etc...
I'm using Delphi 2010
Anyone knows how to fix this?