Skip to content

Commit fbe39fc

Browse files
author
Robbert van Renesse
committed
Merge branch 'next'
2 parents a3bf5d0 + 9441b9b commit fbe39fc

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

harmony_model_checker/harmony/ast.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,15 @@ def ph2(self, scope, code, skip, start, stop, stmt):
371371
else:
372372
code.append(StoreVarOp(None, self.name[0]), start, stop, stmt=stmt)
373373
else:
374-
assert t == "global", (t, v)
374+
if t != "global":
375+
(lexeme, file, line, column) = v
376+
raise HarmonyCompilerError(
377+
message="not a mutable variable: " + lexeme,
378+
lexeme=lexeme,
379+
filename=file,
380+
line=line,
381+
column=column
382+
)
375383
code.append(StoreOp(None, self.name, None), start, stop, stmt=stmt)
376384

377385
def isConstant(self, scope):

harmony_model_checker/modules/synch.hny

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ def notify(c):
6060
def notify_all(c):
6161
atomically !c = bags.empty()
6262

63+
# Deprecated
64+
def notifyAll(c):
65+
atomically !c = bags.empty()
66+
6367
def Semaphore(cnt) returns result:
6468
result = cnt
6569

harmony_model_checker/modules/synchBusy.hny

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def notify(c):
2626
def notify_all(c):
2727
pass
2828

29+
# Deprecated
30+
def notifyAll(c):
31+
pass
32+
2933
def Semaphore(cnt):
3034
result = cnt
3135

harmony_model_checker/modules/synchImprecise.hny

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def notify(c):
3333
def notify_all(c):
3434
c->waiters = {}
3535

36+
# Deprecated
37+
def notifyAll(c):
38+
c->waiters = {}
39+
3640
def Semaphore(cnt):
3741
result = cnt
3842

harmony_model_checker/modules/synchS.hny

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ def notify(c):
5454
atomically if !c != []:
5555
go ((!c)[0]) ()
5656
del (!c)[0]
57-
57+
5858
def notify_all(c):
5959
atomically:
6060
for ctx in !c:
6161
go ctx ()
6262
!c = []
63+
64+
# Deprecated
65+
def notifyAll(c):
66+
notify_all(c)
6367

6468
def Semaphore(cnt):
6569
result = { .count: cnt, .waiters: [] }

0 commit comments

Comments
 (0)