Skip to content

Commit dbaaca5

Browse files
committed
Renamed the field 'monitorCount' in 'java.lang.Object.java' to
'cproverMonitorCount'
1 parent a7364a0 commit dbaaca5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/java/lang/Object.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public class Object {
3434
// lock needed for synchronization in cbmc
3535
// used by monitorenter, monitorexit, wait, and notify
3636
// Not present in the original Object class
37-
public int monitorCount;
37+
public int cproverMonitorCount;
3838

3939
public Object() {
40-
monitorCount = 0;
40+
cproverMonitorCount = 0;
4141
}
4242

4343
public final Class<?> getClass() {
@@ -130,8 +130,8 @@ public static void monitorenter(Object object)
130130
CProver.atomicBegin();
131131
// this assume blocks this execution path in JBMC and simulates
132132
// the thread having to wait because the monitor is not available
133-
CProver.assume(object.monitorCount == 0);
134-
object.monitorCount++;
133+
CProver.assume(object.cproverMonitorCount == 0);
134+
object.cproverMonitorCount++;
135135
CProver.atomicEnd();
136136
}
137137

@@ -140,8 +140,8 @@ public static void monitorenter(Object object)
140140
* It will be called by JBMC when the monitor in this instance
141141
* is being released as a result of either the execution of a
142142
* monitorexit bytecode instruction or the return (normal or exceptional)
143-
* of a synchronized method. It decrements the monitorCounter that had
144-
* been incremented in monitorenter().
143+
* of a synchronized method. It decrements the cproverMonitorCount that
144+
* had been incremented in monitorenter().
145145
*/
146146
public static void monitorexit(Object object)
147147
{
@@ -150,10 +150,10 @@ public static void monitorexit(Object object)
150150
// if (object == null)
151151
// throw new NullPointerException();
152152

153-
// if (object.monitorCount == 0)
153+
// if (object.cproverMonitorCount == 0)
154154
// throw new IllegalMonitorStateException();
155155
CProver.atomicBegin();
156-
object.monitorCount--;
156+
object.cproverMonitorCount--;
157157
CProver.atomicEnd();
158158
}
159159

0 commit comments

Comments
 (0)