Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335609 - ToolTipHelper causing application hangs
Summary: ToolTipHelper causing application hangs
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.2 (Helios SR2)   Edit
Assignee: Lidija Grahek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 15:33 EST by Lidija Grahek CLA
Modified: 2011-05-17 21:55 EDT (History)
3 users (show)

See Also:


Attachments
Patch (796 bytes, patch)
2011-01-27 15:34 EST, Lidija Grahek CLA
wayne.beaton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lidija Grahek CLA 2011-01-27 15:33:09 EST
displayToolTipNear(...) method in ToolTipHelper uses Timer to schedule expiration. However, canceling is done within Display.getDefault().syncExec(...), and it sometimes happens that two threads wait on each other causing a hang. This can be easily fixed by changing syncExec to asyncExec. Note that this code that involves syncExec hasn't changed in a while, but there were some jdk changes (in Timer class) that seem to expose the problem in this case. 

The fix is attached.
Comment 1 Lidija Grahek CLA 2011-01-27 15:34:14 EST
Created attachment 187773 [details]
Patch
Comment 2 Randy Hudson CLA 2011-01-27 15:43:54 EST
Even better would be to avoid using Timer, since it spawns a new thread.  It turns out SWT supports timers already:


Display.getDefault().timerExec(5000, new Runnable()...)
Comment 3 Anthony Hunter CLA 2011-01-28 15:23:19 EST
(In reply to comment #1)
> Created attachment 187773 [details]
> Patch

Reviewed with Alex Boyko and he agrees so committed to R3_6_maintenance and HEAD.