YggLock.mesa
Copyright Ó 1985, 1988 by Xerox Corporation. All rights reserved.
Last edited by
KK on 18-Dec-81 13:41:01
MBrown on January 21, 1983 4:43 pm
Taft on September 30, 1982 3:01 pm
Hauser, May 20, 1985 11:10:09 am PDT
Bob Hagmann September 16, 1988 12:35:57 pm PDT
DIRECTORY
Camelot,
YggDID,
YggEnvironment,
YggInternal;
YggLock: CEDAR DEFINITIONS = BEGIN
LockID: TYPE = YggInternal.LockID;
LockSubID: TYPE = YggInternal.LockSubID;
nullLockID: LockID = YggInternal.nullLockID;
LockMode: TYPE = YggEnvironment.LockMode;
MakeLockID: PROC [did: YggDID.DID] RETURNS [lock: LockID];
Construct the lock identifier for the did/segment/offset
Set: PROC [ trans: YggEnvironment.TransID, lock: LockID, mode: LockMode, wait: BOOLFALSE] RETURNS [granted: BOOL];
Acquires lock, in lock mode mode, for transaction trans.
If the lock cannot immediately be aquired because a conflicting lock is already set
by another transaction, and wait=FALSE, RETURNS FALSE. If wait=TRUE, waits
until the lock can be acquired.
ModeReleasableSet: TYPE = PACKED ARRAY LockMode OF ModeReleasable;
ModeReleasable: TYPE = {no, yes} ← no;
Release: PROC [trans: YggEnvironment.TransID, lock: LockID,
mode: LockMode] RETURNS [released: BOOL];
! Error {lockUnreleasable, unknown};
Releases a lock previously set by the same transaction with this mode.
ReleaseTransactionLocks: PROC [trans: YggEnvironment.TransID] RETURNS [numberReleased: INT];
! Error {lockUnreleasable, unknown};
Releases all locks previously set by this transaction.
Error: ERROR [type: ErrorType];
ErrorType: TYPE = {lockUnreleasable, unknown, unknownLock};
Failed: ERROR [why: YggEnvironment.LockFailure];
{conflict, timeout}
TransAborting: ERROR;
END.
Hauser, March 8, 1985 10:38:48 am PST
Nodified, added copyright.