Article View: borland.public.cppbuilder.nativeapi
Article #15214Re: WaitForSingleObject()
From: Bob Gonder
Date: Sat, 12 Jul 2003 02:57
Date: Sat, 12 Jul 2003 02:57
21 lines
1575 bytes
1575 bytes
"Paul Ooi" wrote:
>for (;;)
>{ switch(WaitForSingleObject(HNDEvent, INFINITE)
> {
> case WAIT_OBJECT_0:
> ......
> break;
> case WAIT_FAILED:
> return 0;
> }
>}
>and I expect WaitForSingleObject() in the infinite loop to return with
>WAIT_FAILED and terminates the thread. Is that OK?
I'd expect WAIT_FAILED if the event handle was invalid; (no wait).
Possable you might get WAIT_ABANDONED too.
I'd try it with replacing case WAIT_FAILED: with default:
That is, ANY return other than what we expect (WAIT_OBJECT_0) will
quit.
Technical Details
Message-ID:
<mrtugv80rjdoc7ub6nca8i6e55jeaar0c8@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f0f500e$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,17beab47e7f815ec X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-11 20:03:07 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: WaitForSingleObject() Date: Fri, 11 Jul 2003 19:57:13 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <mrtugv80rjdoc7ub6nca8i6e55jeaar0c8@4ax.com> References: <3f0f500e$2@newsgroups.borland.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.164.103 X-Trace: newsgroups.borland.com 1057978603 67.31.164.103 (11 Jul 2003 19:56:43 -0700) Lines: 23 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail