PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/test/kilim/test/ex/ExInvalidSynchronized.java

http://github.com/kilim/kilim
Java | 21 lines | 16 code | 4 blank | 1 comment | 0 complexity | b333e68181e87a606084936a0b9a08f4 MD5 | raw file
 1package kilim.test.ex;
 2
 3import kilim.Pausable;
 4
 5
 6// Ensure we don't call a pausable method from within a synchronized block
 7public class ExInvalidSynchronized {
 8    void foo() throws Pausable {}
 9    synchronized void sync() throws Pausable {
10        foo();
11    }
12}
13
14class ExInvalidSynchronized1 {
15    void foo() throws Pausable {}
16    void sync() throws Pausable {
17        synchronized(this) {
18            foo();
19        }
20    }
21}