declare fun {SimpleLock} Token={NewCell unit} proc {Lock P} Old New in {Exchange Token Old New} {Wait Old} {P} New=unit end in 'lock'('lock':Lock) end