Skip to content

Commit

Permalink
Better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert van Renesse committed Nov 1, 2024
1 parent 2c35889 commit 9e80ad4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/lock_tas.hny
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
def test_and_set(s) returns result:
def test_and_set(s) returns oldvalue:
atomically:
result = !s
oldvalue = !s
!s = True

def atomic_store(p, v):
atomically !p = v

def Lock() returns result:
result = False
def Lock() returns initvalue:
initvalue = False

def acquire(lk):
while test_and_set(lk):
Expand Down

0 comments on commit 9e80ad4

Please sign in to comment.