-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handle synchronized blocks created with jsr and ret
- Loading branch information
Showing
8 changed files
with
320 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
public class TestJava1Synchronized { | ||
public void test1(int in) { | ||
synchronized (this) { | ||
if (in == 0) { | ||
System.out.println("0"); | ||
return; | ||
} | ||
|
||
System.out.println("1"); | ||
} | ||
|
||
System.out.println("2"); | ||
} | ||
|
||
public void test2(int in) { | ||
synchronized (this) { | ||
for (int i = 0; i < in; i++) { | ||
System.out.println("hello"); | ||
} | ||
} | ||
} | ||
|
||
public void test3() { | ||
try { | ||
synchronized (this) { | ||
System.out.println("hello"); | ||
} | ||
} finally { | ||
System.out.println("finally"); | ||
} | ||
} | ||
|
||
public void test4() { | ||
try { | ||
System.out.println("try"); | ||
} finally { | ||
synchronized (this) { | ||
System.out.println("hello"); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.