Created attachment 107479 [details]
thread dump of deadlock
I entered Ctrl-space, got the searching/waiting... one line popup. Didn't go away. ESC dismissed. Tried again, still wouldn't complete. Decided to save file and exit IDE. hang. Set to P2 since edits were lost.
The following can be seen in the attached thread dump
Found one Java-level deadlock:
waiting to lock monitor 0x0ba996cc (object 0x19d31620, a org.netbeans.modules.parsing.impl.TaskProcessor$InternalLock),
which is held by "OpenIDE-request-processor-4"
waiting to lock monitor 0x047205f4 (object 0x16db1290, a org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList),
which is held by "AnnotationHolder"
Product Version: NetBeans IDE 7.0 RC1 (Build 201103280000)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\7.0rc1
Editor guys, please evaluate ASAP.
I think I can easily remove the lock that wraps the JavaSourceTaskFactory.reschedule which would most likely fix the problem. The question is whether this is the correct fix.
It may be problem even with other tasks. I am fixing it in TP.
Fixed jet-main 1b4a3c298ee8
Seems fine to me.
Integrated into 7.0 http://hg.netbeans.org/releases/rev/cc774d65701f
There is a way to check if a lock is being held: Thread.holdsLock. Thus:
1. adding new boolean parameter is not necessary, could be replaced with holdsLock call
2. you should add assertFalse(Thread.holdsLock(INTERNAL_LOCK)) into some of your tests, so they fail before your fix and pass now.
Those are my 2Kč. They probably do not influence your fix for 7.0, but at least one could be useful in long term.
For trunk I am planing a bit complex rewrite. But thanks Jardo anyway.
Integrated into 'main-golden', will be available in build *201104060400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Tomas Zezula <firstname.lastname@example.org>
Log: #197404:deadlock involving annotations and hints
No regression met during testing so marking this issue as Verified.