IndexDiffCacheEntry: wait for workspace lock using begin/end rule
commit0625b0e5f6f83f01c2b4ec29671c41b6751a6078
authorJens Baumgart <jens.baumgart@sap.com>
Fri, 6 Jul 2012 23:17:56 +0000 (7 01:17 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 6 Jul 2012 23:17:56 +0000 (7 01:17 +0200)
tree65255ad3c80cfe2fcee991ba8280f7d09c1f2114
parent8e59a80bb8ee0dddcc6029862e1f13e8e7b2d2ce
IndexDiffCacheEntry: wait for workspace lock using begin/end rule

IndexDiffCacheEntry.waitForWorkspaceLock is used to synchronize
IndexDiff calculations with workspace changes. IndexDiff calculation is
started when the workspace can be locked.

The old implementation performed an empty Workspace.run to achieve this.
This could result in the state that Workspace.run acquires scheduling
rule workspace root and waits for OrderedLock because another thread is
broadcasting changes.

To avoid this blocking of workspace root waitForWorkspaceLock now avoids
calling Workspace.run. Instead JobManager().beginRule is used to wait.

Bug: 361758
Change-Id: I611f70c934aefe5993927fa2675325ba11dd5373
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java