Article View: borland.public.cppbuilder.nativeapi
Article #1316Re: Differences between Semaphore and Mutex
From: Bob Gonder
Date: Sun, 16 Sep 2007 13:15
Date: Sun, 16 Sep 2007 13:15
12 lines
1404 bytes
1404 bytes
Mutexes are "owned" Your thread 1 owns the mutext (created with True) Thread 2 Opens and attempts to Release the Mutex. It fails to do so because it does not own the mutex. Thread 2 doesn't even attempt to own the mutex. Meanwhile, thread 1 issues a WaitFor on the mutex it already owns, which succeeds instantly. Semaphores don't have "owners", just "state"
Technical Details
Message-ID:
<kcaqe3d7a9ahqkl01dpp52rerc4g54o9et@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46ecd663@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6b2ce248fe32d850 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Differences between Semaphore and Mutex Date: Sun, 16 Sep 2007 06:15:52 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <kcaqe3d7a9ahqkl01dpp52rerc4g54o9et@4ax.com> References: <46ecd663@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.146.190 X-Trace: newsgroups.borland.com 1189948547 67.77.146.190 (16 Sep 2007 06:15:47 -0700) Lines: 14 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1258