Project: Eclipse_Platform_UI
Bug 76378 [Progress] Deadlock in interaction between ModalContext, UIThread, and background NotifyJob
Reported: 2004-10-15 13:44:23 | Status: verified fixed

org.eclipse.ui.internal.UILockListener seems to contain code that allows the UI thread to obtain locks that are held by another thread, if the UI thread is currently servicing a syncExec request from that other thread. However, when a third thread gets involved this seems to sometimes deadlock. In particular, if workspace background notification is triggered during an workspace operation that contains multiple nested operations, deadlock occurs. Since background notification is timing related, changes in timing can cause otherwise OK code to suddenly begin deadlocking. I've included a JUnit test to reproduce the problem, and a patch that seems to solve it.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/UILockListener.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/deadlock/NestedSyncExecDeadlockTest.java