MonitorLock:
TYPE ~
MACHINE
DEPENDENT
RECORD [
waitersQueue: WaitersQueueRep,
holder: Thread,
pad: TargetArchitecture.Contents
because Mimosa thinks MonitorLocks are 4 words long.
];
WaitersQueueRep:
TYPE ~
MACHINE
DEPENDENT
RECORD [
generalSpinLock: GeneralSpinLockRep,
tail: Thread
];
GeneralSpinLockRep:
TYPE ~
MACHINE
DEPENDENT
RECORD [
locked: LockBit
];
LockBit: TYPE ~ TargetArchitecture.Contents;
Thread: TYPE ~ TargetArchitecture.Contents;
IMPORTANT NOTE:
compiler and other runtime support assumes every data structure can be initialized to zeroes! And the claim here is that a zero is a zero is a zero, regardless of architecture.
nullHolder: Thread ~ TargetArchitecture.zeroContents;
}.