Article View: borland.public.cppbuilder.nativeapi
Article #11560OnTerminate Problems in TThread
From: BillT
Date: Thu, 05 Feb 2004 05:26
Date: Thu, 05 Feb 2004 05:26
54 lines
2195 bytes
2195 bytes
I have a problem with the execution of two threads.
My Main Thread starts Thread 1. When it finishes, I get control at the
OnTerminate routine. That routine triggers a call to a second thread.
The second thread runs but when it finishes, it does not transfer control to
its OnTerminate Routine.
The Docs say that the OnTerminate routines run as part of the main thread. If
that is true, then I should be able to start a second thread in that context.
If not, how can I 'restart' the main thread to get the work moving again?
I have looked into Windows Messages but I don't know which ones are
appropriate
to use to accomplish this.
Bill
--------
My code is:
// Start 1st thread
PackageLoad = new TPackageLoad( TRUE );
PackageLoad->OnTerminate = PackageThreadDone;
PackageLoad->Resume();
//Thread1: (simplified for discussion)
void __fastcall TPackageLoad::Execute()
{
ShowMessage("Unit4");
}
// PackageThreadDone
void __fastcall TForm1::PackageThreadDone(TObject * /*Sender*/)
{
delete PackageLoad;
Loader1();
}
// Loader1
StudioLoad = new TStudioLoad( TRUE );
StudioLoad->OnTerminate = StudioThreadDone;
StudioLoad->Resume();
// StudioThreadDone
void __fastcall TForm1::StudioThreadDone(TObject * /*Sender*/)
{
delete StudioLoad;
Loader2();
}
// Loader2
.... Never gets here....
Technical Details
Message-ID:
<4021d3fe@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,25162141e75feeb5,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-04 21:39:22 PST Newsgroups: borland.public.cppbuilder.nativeapi Subject: OnTerminate Problems in TThread From: billtouch_no_spam@att.net (BillT) X-Newsreader: WinVN 0.99.9 (Released Version) (x86 32bit) MIME-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII NNTP-Posting-Host: 216.195.28.253 Message-ID: <4021d3fe@newsgroups.borland.com> Date: 4 Feb 2004 21:26:22 -0800 X-Trace: newsgroups.borland.com 1075958782 216.195.28.253 (4 Feb 2004 21:26:22 -0800) Lines: 56 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail