Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 166061 Details for
Bug 293995
[Widgets] Deadlock while UI thread displaying/computing a change proposal and non-UI thread creating image
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch using SWT internals to release lock
293995_release_lock_patch.txt (text/plain), 2.01 KB, created by
Markus Keller
on 2010-04-26 07:11:55 EDT
(
hide
)
Description:
Patch using SWT internals to release lock
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2010-04-26 07:11:55 EDT
Size:
2.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeCorrectionProposal.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeCorrectionProposal.java,v >retrieving revision 1.13 >diff -u -r1.13 ChangeCorrectionProposal.java >--- ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeCorrectionProposal.java 25 Apr 2010 22:34:03 -0000 1.13 >+++ ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeCorrectionProposal.java 26 Apr 2010 10:59:57 -0000 >@@ -16,7 +16,10 @@ > import org.eclipse.swt.events.TraverseListener; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.Point; >+import org.eclipse.swt.internal.Lock; >+import org.eclipse.swt.internal.Platform; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -298,11 +301,24 @@ > * @throws CoreException thrown when the change could not be created > */ > public final Change getChange() throws CoreException { >- if (Util.isGtk()) { >+ if (Util.isGtk() && Display.getCurrent() != null) { > // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=293995 : > // [Widgets] Deadlock while UI thread displaying/computing a change proposal and non-UI thread creating image >- if (fChange == null) { >- fChange= createChange(); >+ >+//Copied from Display#sleep(): >+ /* Exit the OS lock to allow other threads to enter GTK */ >+ Lock lock = Platform.lock; >+ int count = lock.lock (); >+ for (int i = 0; i < count; i++) lock.unlock (); >+ try { >+ synchronized (this) { >+ if (fChange == null) { >+ fChange= createChange(); >+ } >+ } >+ } finally { >+ for (int i = 0; i < count; i++) lock.lock (); >+ lock.unlock (); > } > } else { > synchronized (this) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 293995
:
166018
| 166061