Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Quick thread qu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 5967 of 6114
Post > Topic >>

Quick thread question

by "vertuas" <vertuas@[EMAIL PROTECTED] > Jan 23, 2008 at 08:13 AM

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;
 




 5 Posts in Topic:
Quick thread question
"vertuas" <v  2008-01-23 08:13:03 
Re: Quick thread question
Rob Kennedy <me3@[EMAI  2008-01-23 09:05:20 
Re: Quick thread question
"vertuas" <v  2008-01-23 15:28:07 
Re: Quick thread question
Rob Kennedy <me3@[EMAI  2008-01-23 19:45:59 
Re: Quick thread question
mdR <mrafn@[EMAIL PROT  2008-01-23 09:43:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:13:42 CDT 2008.