Hi all,
I an using a 3rd party component to process data.
The problem is that the call to the "start processing" method return
emmidiaty and the component fires an event when it finished.
Now i need to set up a thread i can run, that sets up a component, start
processing and then waist for the finished event before terminating.
Can i set up a semaphore in my thread and us WaitForSingleObject??
A bit like (if over simplified) :
Var threadEvent : TEvent;
procedure TThread.Execute;
begin
//Setup processing
//Start processing
..........
TEvent.create;
WaitForSingleObject(theadEvent, 600000);
..........
//Free process
end;
procedure THread.OnProcessDone;
begin
TEvent.reset;
end;