Article View: borland.public.cppbuilder.nativeapi
Article #15213WaitForSingleObject()
From: Paul Ooi
Date: Sat, 12 Jul 2003 00:02
Date: Sat, 12 Jul 2003 00:02
32 lines
1611 bytes
1611 bytes
I need help with the following problem.
In a separate thread, I have a switch statement in an infinite loop like
this.
for (;;)
{
switch(WaitForSingleObject(HNDEvent, INFINITE)
{
case WAIT_OBJECT_0:
......
......
break;
case WAIT_FAILED:
return 0;
}
}
HNDEvent is a handle to an event.
In the primary thread, when a terminate signal is received, it closes the
event handle.
CloseHandle(HNDEvent);
and I expect WaitForSingleObject() in the infinite loop to return with
WAIT_FAILED and
terminates the thread. Is that OK?
Paul
Technical Details
Message-ID:
<3f0f500e$2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!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,17beab47e7f815ec,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-11 17:09:40 PST From: "Paul Ooi" <yitung.ooi@student.unsw.edu.au> Newsgroups: borland.public.cppbuilder.nativeapi Subject: WaitForSingleObject() Date: Sat, 12 Jul 2003 08:02:37 +0800 Lines: 34 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: 129.94.198.109 Message-ID: <3f0f500e$2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1057968142 129.94.198.109 (11 Jul 2003 17:02:22 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail