=== Opposite lock order: a real deadlock, detected via ThreadMXBean === thread-1: holding lockA, waiting for lockB thread-2: holding lockB, waiting for lockA main: findDeadlockedThreads() detected 2 deadlocked threads thread-1 is blocked on java.lang.Object@5451c3a8, owned by thread-2 thread-2 is blocked on java.lang.Object@49476842, owned by thread-1 === Same lock order on both threads: no deadlock possible === thread-1 (fixed order): acquired both locks, done thread-2 (fixed order): acquired both locks, done main: both fixed-order threads finished, isAlive t1=false t2=false done (the process exits here - the two deadlocked threads above never finish)