<> <> <> <> <> <> <> DIRECTORY AlpineEnvironment, AlpineInternal, FileInstance, FileLockFormat, TransactionMap; FileLock: DEFINITIONS = BEGIN LockMode: TYPE = AlpineEnvironment.LockMode; LockOption: TYPE = AlpineEnvironment.LockOption; PageNumber: TYPE = AlpineEnvironment.PageNumber; Property: TYPE = AlpineEnvironment.Property; PageRun: TYPE = AlpineEnvironment.PageRun; TransID: TYPE = AlpineEnvironment.TransID; AssertedPageLock: TYPE = LockMode [read..write]; -- subranges of LockMode as applied to files AssertedFileLock: TYPE = LockMode [read..readIntendWrite]; IntentionFileLock: TYPE = LockMode [intendRead..intendWrite]; AcquireFileLock: PROCEDURE [fileInstance: FileInstance.Handle, requested: LockOption, minimum: LockMode, cacheTrans: TransID _ AlpineEnvironment.nullTransID]; <> <> ReleaseFileLock: PROCEDURE [fileInstance: FileInstance.Handle, retainCacheLock: BOOL _ FALSE]; <> <> <<>> IsWholeFileLock: PROCEDURE [lockID: AlpineInternal.LockID] RETURNS [BOOLEAN] ~ INLINE { RETURN[ LOOPHOLE[lockID.subSubEntity, FileLockFormat.FileLockSubID].type = file ] }; <<>> ReleaseFile: PROCEDURE [fileInstance: FileInstance.Handle, retainCacheLocks: BOOLEAN _ FALSE]; <> <> AcquirePageLocks: PROCEDURE [fileInstance: FileInstance.Handle, pageRun: PageRun, requested: LockOption, minimum: AssertedPageLock, cacheTrans: AlpineEnvironment.TransID _ AlpineEnvironment.nullTransID]; <> <> ReleasePageLocks: PROCEDURE [fileInstance: FileInstance.Handle, pageRun: PageRun, mode: LockMode _ read, retainCacheLocks: BOOLEAN _ FALSE]; <> AcquirePropertyLock: PROCEDURE [fileInstance: FileInstance.Handle, property: Property, requested: LockOption, minimum: AssertedPageLock]; <> <> ReleasePropertyLock: PROCEDURE [fileInstance: FileInstance.Handle, property: Property, mode: LockMode _ read]; <> AcquireSizeLock: PROCEDURE [fileInstance: FileInstance.Handle, requested: LockOption, minimum: AssertedPageLock]; <> <> AcquireVolumeGroupLock: PROCEDURE [volumeGroupID: AlpineEnvironment.VolumeGroupID, trans: TransactionMap.Handle, requested: LockOption, minimum: AssertedPageLock]; <> <> ValidateCachePageLocks: PROCEDURE [fileInstance: FileInstance.Handle, cacheTrans: TransID, pageRun: PageRun] RETURNS[success: BOOLEAN]; <> <<>> END. <> <> <<>>