🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10159

Re: Manx help

#10159
From: Chuck McManis
Date: Sat, 29 Oct 1988 00:30
24 lines
1530 bytes
In article <5918@killer.DALLAS.TX.US> (Jim Pritchett) writes:
>                          ...  I'm sure that there is a problem with my
>(mis)understanding of locks, but I don't know what it is.  

Locks are "funny" but once you get to know them they can be your friends.
Point #1 Lock() returns a BPTR to a FileLock structure, *not* a pointer.
Point #2 Only unlock what you lock.

Check this out ...
->  lockram = Lock("ram:t", ACCESS_READ);	/* cool you get a lock */
->  lockcd = CurrentDir(lockram);
->  UnLock(lockram);				/* Once */
->  lockram = CurrentDir(lockcd);		
->  UnLock(lockcd);				/* Twice */
->  UnLock(lockram);				/* Three times your out. */
->}

The only lock you can legally unlock is the one in lockram originally.
When you entered you had a lock in CurrentDir (which you don't "own")
and you didn't leave one there when you left. Understand?

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
Technical Details
Message-ID: <75253@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!sun!pepper!cmcmanis
References: <5918@killer.DALLAS.TX.US>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Manx help
Keywords: Manx Aztec DOS Locks
Message-ID: <75253@sun.uucp>
Date: 29 Oct 88 00:30:23 GMT
References: <5918@killer.DALLAS.TX.US>
Sender: news@sun.uucp
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Organization: Sun Microsystems, Mountain View
Lines: 24