Skip to content

Commit 59198f7

Browse files
Degiorgiopeterschrammel
authored andcommitted
Added new method to the CProver API, getCurrentThreadID()
1 parent 2c171bf commit 59198f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/cprover/CProver.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ public static void endThread(int id)
208208
}
209209
}
210210

211+
/**
212+
* This method is used by JBMC to return the ID of the executing thread.
213+
*/
214+
public static int getCurrentThreadID()
215+
{
216+
if(enableConcurrency)
217+
{
218+
throw new RuntimeException(
219+
"Cannot execute program with CProver.getCurrentThreadID()");
220+
}
221+
return 0;
222+
}
223+
211224
/**
212225
* This method is used by jbmc to indicate an atomic section which enforces
213226
* the bmc equation to avoid interleavings of the code inside the section

0 commit comments

Comments
 (0)