🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: WaitForMulipleObjects function

#3243
From: Bob Gonder
Date: Mon, 07 Aug 2006 16:51
20 lines
1593 bytes
mauro russo wrote:

>Really i hoped you know already.

One never really "knows" until they do it themselves.

>      if ( (w >= WAIT_OBJECT_0) & (w < WAIT_OBJECT_0 + NMsToWait) )

	Wrong "AND", use &&
>        ...
>For the thread "th2", the API fails [w = WAIT_FAILED] and GetLastError()
>gets the value six (6).

And....what does 6 mean?   (See FormatMessage() )
Thread 1 exits after accepting mutex1, which closes that handle.
Thread2 then attempts to use the closed handle.

>some help for me?

Run my code.
Technical Details
Message-ID: <nvped25gk8hs0bdhpkb8a4mmnlau7akc8c@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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
References: <44d62a4a$1@newsgroups.borland.com> <prpcd2hj1di4dpm4uqun57ncaj7g69fkl9@4ax.com> <44d707a0@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: Mon, 07 Aug 2006 09:51:35 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <nvped25gk8hs0bdhpkb8a4mmnlau7akc8c@4ax.com>
References: <44d62a4a$1@newsgroups.borland.com> <prpcd2hj1di4dpm4uqun57ncaj7g69fkl9@4ax.com> <44d707a0@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 1154969493 71.0.32.99 (7 Aug 2006 09:51:33 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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