Article View: borland.public.cppbuilder.nativeapi
Article #3234Re: WaitForMulipleObjects function
From: Bob Gonder
Date: Sun, 06 Aug 2006 22:17
Date: Sun, 06 Aug 2006 22:17
29 lines
1693 bytes
1693 bytes
mauro russo wrote:
>if i use the value FALSE for the bWaitAll parameter
>and more objects are signalled, i expect that the thread that
>called WaitForMultipleObjects acquires only one [that with the
>minimum index] of those objects.
>Is it like that?
>
>But i hope some of you can make me sure about my idea.
Test it.
#include <stdio.h>
#include <conio.h>
#include <windows.h>
int main(void)
{ int i;
DWORD w;
HANDLE Events[5];
for( i=0; i<5; ++i )
Events[i]=CreateEvent(NULL,FALSE,TRUE,NULL);
do{
w = WaitForMultipleObjects( 5, Events, FALSE, 1000 );
if( w >= WAIT_OBJECT_0 )
printf( "Event %i Reported\r\n", w-WAIT_OBJECT_0 );
}while( w !=WAIT_TIMEOUT );
getch();
return 0;
}
Technical Details
Message-ID:
<prpcd2hj1di4dpm4uqun57ncaj7g69fkl9@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44d62a4a$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8747f5d210339525 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: WaitForMulipleObjects function Date: Sun, 06 Aug 2006 15:17:53 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <prpcd2hj1di4dpm4uqun57ncaj7g69fkl9@4ax.com> References: <44d62a4a$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 71.0.32.99 X-Trace: newsgroups.borland.com 1154902674 71.0.32.99 (6 Aug 2006 15:17:54 -0700) Lines: 31 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail