Skip to content

Commit 001fca0

Browse files
authored
Merge pull request #2280 from cesaro/java-concurrency-synchronization
Java threading: support for synchronization
2 parents 0062a9c + 68ac566 commit 001fca0

File tree

102 files changed

+1345
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1345
-123
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ install:
1818
Move-Item win_flex.exe bin\flex.exe -force
1919
Move-Item FlexLexer.h include\FlexLexer.h -force
2020
Remove-Item bin\data -Force -Recurse -ErrorAction SilentlyContinue
21+
Remove-Item java-models-library-master -Force -Recurse -ErrorAction SilentlyContinue
2122
Move-Item data bin\data -force
2223
bison -V
2324
flex -V
@@ -90,7 +91,6 @@ test_script:
9091
rmdir /s /q jbmc\classpath1
9192
rmdir /s /q jbmc\jar-file3
9293
rmdir /s /q jbmc\tableswitch2
93-
rmdir /s /q jbmc-concurrency\explicit_thread_blocks
9494
cd ../..
9595
9696
make -C jbmc/regression test
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import java.lang.Thread;
2+
import org.cprover.CProver;
3+
4+
public class A
5+
{
6+
int x = 0;
7+
8+
// expected verfication success
9+
public void me()
10+
{
11+
Thread t = new Thread()
12+
{
13+
public void run()
14+
{
15+
x = 44;
16+
int local_x = x;
17+
assert(local_x == 44 || x == 10);
18+
}
19+
};
20+
t.start();
21+
x = 10;
22+
}
23+
24+
// expected verfication failure
25+
public void me2()
26+
{
27+
Thread t = new Thread()
28+
{
29+
public void run()
30+
{
31+
x = 44;
32+
int local_x = x;
33+
assert(local_x == 44);
34+
}
35+
};
36+
t.start();
37+
x = 10;
38+
}
39+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
A.class
3+
--function 'A.me:()V' --lazy-methods --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --java-threading
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
A.class
3+
--function 'A.me2:()V' --lazy-methods --java-threading --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
4+
^SIGNAL=0$
5+
^VERIFICATION FAILED$
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CORE
22
A.class
3-
--function "A.me:()V" --lazy-methods --java-threading
4-
3+
--function 'A.me:()V' --lazy-methods --java-threading
54
^EXIT=0$
65
^SIGNAL=0$
76
^VERIFICATION SUCCESSFUL

0 commit comments

Comments
 (0)