Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-12-06 09:40:21 +0000
committerUwe Stieber2012-12-06 09:40:21 +0000
commit630f12baedc116c343402c87a25e64af04b62c42 (patch)
tree2ad4b9d6095296c1b14339cf2e7a344e3ba60efc
parent6004f424ae4198149cf24fbf87c8076c2b7fb17e (diff)
downloadorg.eclipse.tcf-630f12baedc116c343402c87a25e64af04b62c42.tar.gz
org.eclipse.tcf-630f12baedc116c343402c87a25e64af04b62c42.tar.xz
org.eclipse.tcf-630f12baedc116c343402c87a25e64af04b62c42.zip
Target Explorer: Remove some waits in the System Manager content provider causing the UI refresh to hang up
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java20
2 files changed, 3 insertions, 24 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
index 46a0f3766..0220cf25a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
@@ -344,9 +344,8 @@ public class PeerModel extends ContainerModelNode implements IPeerModel {
*/
@Override
public boolean isVisible() {
- Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
- return getPeer() != null && getPeer().getAttributes().containsKey(IPeerModelProperties.PROP_VISIBLE)
- ? Boolean.valueOf(getPeer().getAttributes().get(IPeerModelProperties.PROP_VISIBLE)).booleanValue()
- : true;
+ IPeer peer = getPeer();
+ return peer != null && peer.getAttributes().containsKey(IPeerModelProperties.PROP_VISIBLE)
+ ? Boolean.valueOf(peer.getAttributes().get(IPeerModelProperties.PROP_VISIBLE)).booleanValue() : true;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
index 39b4f6863..10ff048c5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
@@ -101,7 +101,6 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
* @return <code>True</code> if the peer model node is a proxy or value-add, <code>false</code> otherwise.
*/
/* default */ final boolean isProxyOrValueAdd(IPeerModel peerModel) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(peerModel);
boolean isProxy = peerModel.getPeer().getAttributes().containsKey("Proxy"); //$NON-NLS-1$
@@ -119,7 +118,6 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
* @return <code>True</code> if filtered, <code>false</code> otherwise.
*/
/* default */ final boolean isFiltered(IPeerModel peerModel) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(peerModel);
boolean filtered = false;
@@ -155,9 +153,6 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
final IPeerModel[] peers = model.getPeers();
final List<IPeerModel> candidates = new ArrayList<IPeerModel>();
- final Runnable runnable = new Runnable() {
- @Override
- public void run() {
if (IUIConstants.ID_CAT_FAVORITES.equals(catID)) {
for (IPeerModel peer : peers) {
ICategorizable categorizable = (ICategorizable)peer.getAdapter(ICategorizable.class);
@@ -259,21 +254,6 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
candidates.add(peer);
}
}
- }
- };
-
- Assert.isTrue(!Protocol.isDispatchThread());
-
- // The caller thread is very likely the display thread. We have to us a little
- // trick here to avoid blocking the display thread via a wait on a monitor as
- // this can (and has) lead to dead-locks with the TCF event dispatch thread if
- // something fatal (OutOfMemoryError in example) happens in-between.
- ExecutorsUtil.executeWait(new Runnable() {
- @Override
- public void run() {
- Protocol.invokeAndWait(runnable);
- }
- });
children = candidates.toArray(new IPeerModel[candidates.size()]);
}

Back to the top