!7 sclass ProvokeDeadLock > DynPrintLog { transient Lock a = fairLock(); transient Lock b = fairLock(); JComponent visualize() { ret withCenteredButtons(super.visualize(), "Do the deadlock", rThread doIt); } void doIt { print("Initiating deadlock... :-)\n"); thread "A" { lock a; // cool new syntax! print("Thread A has lock A."); sleep1Second(); print("Thread A getting lock B."); lock b; print("Thread A successful!"); } thread "B" { lock b; print("Thread B has lock B."); sleep1Second(); print("Thread B getting lock A."); lock a; print("Thread B successful!"); } } }