// Test synchronized blocks with complex guards. // Relevant PR: PR788 // Expected result: PASS class L8 { public static synchronized void main(String[] args) { for (int single i = 0; i < Ti.numProcs(); Ti.barrier(), i++) { if (i == Ti.thisProc()) { System.out.println("proc " + i); L8 prefs = new L8(); synchronized (prefs.lock.lock) { System.out.println("critical section 1"); } Object o = prefs; synchronized (((L8) prefs).lock) { System.out.println("critical section 2"); } } // extra time for GLUnix to flush streams try { Thread.sleep(2000); } catch (InterruptedException e) { } } } L8 lock = this; }