🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Need help with Mutex

#2064
From: Bob Gonder
Date: Sat, 28 Apr 2007 17:36
10 lines
1528 bytes
Dennis Jones wrote:

>Perhaps I am mistaken, but it looks to me like the problem is obvious...your 
>comment says, "Create a mutex with no initial owner", but the code creates 
>it owned (conflicts with the comment).  Then you attempt to wait for the 
>mutex, and 5 seconds later, due to timeout, the exception is thrown.

The CreateMutex(true) returns with ownership.
The wait() satisfies with pre-ownership to eliminate deadlock.
Drawback is now the mutex is owned twice and should be released twice.
Technical Details
Message-ID: <i717339g3u8esppurihllgq3aj0a5qelig@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!proxad.net!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4633777f$1@newsgroups.borland.com> <4633807b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,28184df4065864d1
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: Need help with Mutex
Date: Sat, 28 Apr 2007 10:36:20 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <i717339g3u8esppurihllgq3aj0a5qelig@4ax.com>
References: <4633777f$1@newsgroups.borland.com> <4633807b$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: 67.77.147.157
X-Trace: newsgroups.borland.com 1177781778 67.77.147.157 (28 Apr 2007 10:36:18 -0700)
Lines: 12
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!proxad.net!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail