🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11592

Re: WaitForMultipleObjects in TThread

#11592
From: Kristoffer Persson
Date: Fri, 30 Jan 2004 07:27
16 lines
1617 bytes
> > I would like to call WaitForSingleObjects infinitely in TThread, to wait
for
> > a handle to be signalled. How can I know when the thread should be
> > terminated (like thread receiving a WM_QUIT message)?
> >
>
> Use WaitForMultipleObjects and define an array of events (a terminate
> event, your origin event ...). When the wait returns, react on the
> WAIT_OBJECT_0 ... WAIT_OBJECT_X return values and let your thread end
> gracefully if it receives the terminate event.

Thanks, but how do I get the quit message to signal my terminate event?
Especially since I'm stuck in the WaitForMultipleObjects call. It's probably
something simple...

- Kristoffer -
Technical Details
Message-ID: <401a0744$1@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-mail
References: <40191ff7$1@newsgroups.borland.com> <1075389099.199618@post.sympatec.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2e632a3799f22e8b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-29 23:39:25 PST
From: "Kristoffer Persson" <no@email>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40191ff7$1@newsgroups.borland.com> <1075389099.199618@post.sympatec.net>
Subject: Re: WaitForMultipleObjects in TThread
Date: Fri, 30 Jan 2004 08:27:24 +0100
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 193.15.214.81
Message-ID: <401a0744$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1075447620 193.15.214.81 (29 Jan 2004 23:27:00 -0700)
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