Article View: borland.public.cppbuilder.nativeapi
Article #15896Re: Mutex and program instancenumbers
From: Remy Lebeau (TeamB)
Date: Fri, 06 Jun 2003 16:46
Date: Fri, 06 Jun 2003 16:46
18 lines
1612 bytes
1612 bytes
"Hans Galema" <j.m.galema.dontusethis@maartens.nl> wrote in message
news:3ee0b2cd@newsgroups.borland.com...
> __fastcall TForm1::~TForm1(void)
> {
> if ( mutex ) ReleaseMutex (mutex) ;
> }
You should be calling CloseHandle(), not ReleaseMutex(). Your clients are
not obtaining the instance numbers correctly because the original mutexes
are never getting freed correctly, thus they still exist for future client
instances to find even though the earlier instances are long gone.
ReleaseMutex does not free the mutex, it releases the lock on the mutex if
you use one of the WaitFor...() API functions to obtain the lock.
Gambit
Technical Details
Message-ID:
<3ee0c4a0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ee0b2cd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,aeacbe3cdfad6f92 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-06 09:51:05 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ee0b2cd@newsgroups.borland.com> Subject: Re: Mutex and program instancenumbers Date: Fri, 6 Jun 2003 09:46:23 -0700 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3ee0c4a0@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054917792 207.175.226.26 (6 Jun 2003 09:43:12 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail