DIRECTORY YggEnvironment, YggInternal, YggOpenDoc, YggFileLockFormat, YggTransactionMap; YggFileLock: CEDAR DEFINITIONS = BEGIN LockMode: TYPE = YggEnvironment.LockMode; LockOption: TYPE = YggEnvironment.LockOption; PageNumber: TYPE = YggEnvironment.PageNumber; PageRun: TYPE = YggEnvironment.PageRun; AssertedPageLock: TYPE = LockMode [read..write]; -- subranges of LockMode as applied to files AssertedFileLock: TYPE = LockMode [read..readIntendWrite]; IntentionFileLock: TYPE = LockMode [intendRead..intendWrite]; AcquireFileLock: PROCEDURE [doc: YggOpenDoc.OpenDoc, requested: LockOption, minimum: LockMode]; ReleaseFileLock: PROCEDURE [doc: YggOpenDoc.OpenDoc]; IsWholeFileLock: PROCEDURE [lockID: YggInternal.LockID] RETURNS [BOOLEAN]; ReleaseFile: PROCEDURE [doc: YggOpenDoc.OpenDoc]; AcquirePageLocks: PROCEDURE [doc: YggOpenDoc.OpenDoc, pageRun: PageRun, requested: LockOption, minimum: AssertedPageLock]; ReleasePageLocks: PROCEDURE [doc: YggOpenDoc.OpenDoc, pageRun: PageRun, mode: LockMode _ read]; AcquireSizeLock: PROCEDURE [doc: YggOpenDoc.OpenDoc, requested: LockOption, minimum: AssertedPageLock]; AcquireVolumeGroupLock: PROCEDURE [volumeGroupID: YggEnvironment.VolumeGroupID, trans: YggTransactionMap.TransHandle, requested: LockOption, minimum: AssertedPageLock]; END. ΄YggFileLock.mesa Copyright Σ 1985, 1988 by Xerox Corporation. All rights reserved. Lock operations specialized to files Last edited by: Taft on April 6, 1983 4:58 pm Carl Hauser, January 8, 1986 11:29:20 am PST Bob Hagmann May 3, 1988 9:59:42 am PDT ! Lock.Failed, Lock.TransAborting; Acquires the MAX of requested.mode and minimum for the file. ! Lock.Error {unknown}; Releases a file lock previously set by AcquireFileLock. Note that locks are reference-counted and are not removed (or downgraded) until one Release has been done for each Acquire. A file lock of any strength may be released; it is the client's responsibility to ensure consistency. Attempts to release nonexistent locks are ignored. IsWholeFileLock: PROCEDURE [lockID: YggInternal.LockID] RETURNS [BOOLEAN] ~ INLINE { RETURN[ LOOPHOLE[lockID.subSubEntity, YggFileLockFormat.FileLockSubID].type = file ] }; ! Lock.Error {unknown}; Releases file and page locks previously set by AcquireFileLock and AcquirePageLocks with LockMode = Read. Reference counts are ignored. Attempts to release nonexistent locks are ignored. ! Lock.Failed, Lock.TransAborting; Acquires the MAX of requested.mode and minimum for the specified page(s), and upgrades the file lock if necessary. Does not acquire page locks already subsumed by a whole-file lock. Lock.Failed may be raised after some of the pages have already been locked, and those locks may not have been released. Releases page lock(s) previously set by AcquirePageLocks iff they are currently locked in the specified mode. (A non-default mode should not be passed unless you know what you are doing.) Note that locks are reference-counted and are not removed (or downgraded) until one Release has been done for each Acquire. Attempts to release locks other than mode are ignored without error indication, as are attempts to release nonexistent locks. File intention locks that were set while acquiring the page lock(s) are NOT released. ! Lock.Failed, Lock.TransAborting; Acquires the MAX of requested.mode and minimum for the file's size. ! Lock.Failed, Lock.TransAborting; Acquires the MAX of requested.mode and minimum for the volume group. Hauser, March 7, 1985 2:54:15 pm PST Added copyright. Κ– "cedar" style˜šœ™IcodešœB™B—Jšœ$™$šœ™Jšœ™K™,K™&—unitšΟk ˜ Kšœ˜Kšœ ˜ Kšœ ˜ Kšœ˜Kšœ˜—šœ œ˜ Jš˜J˜Kšœ œ˜)Kšœ œ˜-Kšœ œ˜-Kšœ œ˜'J˜KšœœΟc,˜]Kšœœ$˜:Kšœœ&˜=šΟnœ œE˜_Jšœ"™"Jšœ œ,™<—šŸœ œ˜5Jšœ™JšœΞ™ΞJ™—JšŸœ œœœ˜JšŸœ œœœœœœG™¬J™J™—šŸ œ œ˜1Jšœ™JšœΌ™Ό—šŸœ œC˜^J˜Jšœ"™"Jšœ œŸ™―—šŸœ œD˜_Jšœ™—šŸœ œM˜gJšœ"™"JšœC™C—šŸœ œ‡˜¨Jšœ"™"JšœD™D—Lšœ˜—™$K™—K™—…— Ϊ