File tree 2 files changed +52
-0
lines changed
2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -2834,6 +2834,11 @@ void java_bytecode_convert_method(
2834
2834
" nondetWithNull" ,
2835
2835
" nondetWithoutNull" ,
2836
2836
" notModelled" ,
2837
+ " atomicBegin" ,
2838
+ " atomicEnd" ,
2839
+ " startThread" ,
2840
+ " endThread" ,
2841
+ " getCurrentThreadID"
2837
2842
};
2838
2843
2839
2844
if (std::regex_match (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ public final class CProver
4
4
{
5
5
public static boolean enableAssume =true ;
6
6
public static boolean enableNondet =true ;
7
+ public static boolean enableConcurrency =true ;
7
8
8
9
public static boolean nondetBoolean ()
9
10
{
@@ -115,6 +116,52 @@ public static <T> T nondetWithoutNull()
115
116
return null ;
116
117
}
117
118
119
+ public static void startThread (int id )
120
+ {
121
+ if (enableConcurrency )
122
+ {
123
+ throw new RuntimeException (
124
+ "Cannot execute program with CProver.startThread()" );
125
+ }
126
+ }
127
+
128
+ public static void endThread (int id )
129
+ {
130
+ if (enableConcurrency )
131
+ {
132
+ throw new RuntimeException (
133
+ "Cannot execute program with CProver.endThread()" );
134
+ }
135
+ }
136
+
137
+ public static void atomicBegin ()
138
+ {
139
+ if (enableConcurrency )
140
+ {
141
+ throw new RuntimeException (
142
+ "Cannot execute program with CProver.atomicBegin()" );
143
+ }
144
+ }
145
+
146
+ public static void atomicEnd ()
147
+ {
148
+ if (enableConcurrency )
149
+ {
150
+ throw new RuntimeException (
151
+ "Cannot execute program with CProver.atomicEnd()" );
152
+ }
153
+ }
154
+
155
+ public static int getCurrentThreadID ()
156
+ {
157
+ if (enableConcurrency )
158
+ {
159
+ throw new RuntimeException (
160
+ "Cannot execute program with CProver.getCurrentThreadID()" );
161
+ }
162
+ return 0 ;
163
+ }
164
+
118
165
public static void assume (boolean condition )
119
166
{
120
167
if (enableAssume && !condition )
You can’t perform that action at this time.
0 commit comments