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.

Bug 172857

Summary: Deadlock After pressing Go back to button in editor toolbar
Product: editor Reporter: Petr Cyhelsky <cyhelsky>
Component: -- Other --Assignee: Vitezslav Stejskal <vstejskal>
Status: RESOLVED FIXED    
Severity: blocker Keywords: RANDOM, THREAD
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:
Attachments: ThreadDump
Removing extWriteLock/Unlock

Description Petr Cyhelsky 2009-09-23 11:08:48 UTC
see the attached threaddump
Comment 1 Petr Cyhelsky 2009-09-23 11:09:46 UTC
Created attachment 88174 [details]
ThreadDump
Comment 2 Vitezslav Stejskal 2009-09-25 10:25:40 UTC
"org.openide.text Document Processing" vs. "AWT-EventQueue-1" - I'll have a closer look.
Comment 3 Vitezslav Stejskal 2009-09-25 11:39:18 UTC
Created attachment 88347 [details]
Removing extWriteLock/Unlock
Comment 4 Vitezslav Stejskal 2009-09-25 11:49:13 UTC
GuardedDocument uses extWriteLock/Unlock when adding DrawLayer for a style, which IMO is unnecessary. Even acquiring a
readlock is not neccessary for that matter. See the attached patch. I'll discuss it with Mila next week.

I'm obviously leaving alone the fact that both NbDocument, DocumentLine and GuardedDocument is in this part using long
time deprecated stuff. Plus GuardedDocument implements StyleDocument is now a pure historical artifact. This
implementation must have lost its meaning ages ago with invention of editor annotations...
Comment 5 Miloslav Metelka 2009-09-29 10:16:51 UTC
Since the addStyledLayer() leads to firing of a DocumentEvent we agreed with Vita that we will surround the addStyledLayer() with readLock().
Comment 6 Vitezslav Stejskal 2009-09-29 14:36:29 UTC
http://hg.netbeans.org/jet-main/rev/74632ab062df