[hg] main-silver: More reliable refresh scheduling.

  • From:
  • To:
  • Subject: [hg] main-silver: More reliable refresh scheduling.
  • Date: Fri, 21 Sep 2012 02:30:53 -0700

changeset 49cc8c4e9ebe in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/49cc8c4e9ebe
description:
        More reliable refresh scheduling.

diffstat:

 
debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.java
 |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (44 lines):

diff --git 
a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.java
 
b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.java
--- 
a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.java
+++ 
b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.java
@@ -69,6 +69,7 @@
 import java.util.ConcurrentModificationException;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.prefs.PreferenceChangeEvent;
 import java.util.prefs.PreferenceChangeListener;
 import java.util.prefs.Preferences;
@@ -141,7 +142,7 @@
     private transient Color treeBackgroundColor = 
UIManager.getDefaults().getColor("Tree.textBackground"); // NOI18N
     
     private transient RequestProcessor requestProcessor = new 
RequestProcessor("DebuggingView Refresh Scheduler", 1);
-    private transient boolean refreshScheduled = false;
+    private transient AtomicBoolean refreshScheduled = new 
AtomicBoolean(false);
     private transient ExplorerManager manager = new ExplorerManager();
     private transient ViewLifecycle viewLifecycle;
     private Preferences preferences = 
NbPreferences.forModule(getClass()).node("debugging"); // NOI18N
@@ -661,13 +662,13 @@
     }
     
     void refreshView() {
-        if (refreshScheduled) {
+        if (refreshScheduled.getAndSet(true)) {
             return;
         }
-        refreshScheduled = true;
         requestProcessor.post(new Runnable() {
             @Override
             public void run() {
+                refreshScheduled.set(false);
                 JPDAThread currentThread;
                 ThreadsCollector tc;
                 synchronized (DebuggingView.this.lock) {
@@ -825,7 +826,6 @@
         @Override
         public void run() {
             DebugTreeView tView = getTreeView();
-            refreshScheduled = false;
             leftPanel.clearBars();
             rightPanel.startReset();
             int sx = (rightPanel.getWidth() - 
ClickableIcon.CLICKABLE_ICON_WIDTH) / 2;

[hg] main-silver: More reliable refresh scheduling.

mentlicher 09/21/2012

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 51 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close