This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 8.1 (Build 201510222201) Operating System = Windows 10 version 10.0 running on amd64 Java; VM; Vendor = 1.8.0_73 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.73-b02 Reproducibility: Happens every time STEPS: Run the following program in Debug mode and press Debug -> Check for Deadlock. This is a Deadlock, but it doesn't detect one. public class ThreadLocalExample { private static Thread thread1; private static Thread thread2; public static class MyRunnable implements Runnable { private final ThreadLocal<Integer> threadLocal = new ThreadLocal<>(); @Override public void run() { String name = Thread.currentThread().getName(); System.out.println("RUNNING: " + name); int v = (int) (Math.random() * 100D); threadLocal.set(v); System.out.println("SETTING TO '" + name + "' = " + v); try { if(name.equals("T1")) { System.out.println("WAITING FOR T2 TO COMPLETE..."); thread2.join(); } else { System.out.println("WAITING FOR T1 TO COMPLETE..."); thread1.join(); } Thread.sleep(2000); } catch (InterruptedException e) { } System.out.println("ENDING " + name + " " + threadLocal.get()); } } public static void main(String[] args) throws InterruptedException { MyRunnable sharedRunnableInstance = new MyRunnable(); thread1 = new Thread(sharedRunnableInstance, "T1"); thread2 = new Thread(sharedRunnableInstance, "T2"); thread1.start(); thread2.start(); } } ACTUAL: No Deadlock Detected EXPECTED: Deadlock Detecte
Fixed by changeset: 297345:e09b98cc6446 http://hg.netbeans.org/core-main/rev/e09b98cc6446
Integrated into 'main-silver', will be available in build *201605220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/e09b98cc6446 User: mentlicher@netbeans.org Log: #258400: Deadlock caused by waiting for Thread.join() is detected.