Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2012-12-18 14:45:28 +0000
committerJohn Arthorne2012-12-18 14:46:28 +0000
commit168c5facecd5d073c827905b7333f8e6b72c792a (patch)
treeb848f9d682219a9d993fb4256b7fcbcf0c86ff12
parentea10500d10b50be1b3794410202e45f10b18169e (diff)
downloadeclipse.platform.resources-168c5facecd5d073c827905b7333f8e6b72c792a.tar.gz
eclipse.platform.resources-168c5facecd5d073c827905b7333f8e6b72c792a.tar.xz
eclipse.platform.resources-168c5facecd5d073c827905b7333f8e6b72c792a.zip
Bug 396840 - win32 refresh monitor rescheduling too slowlyv20121218-144628I20121218-1600
-rw-r--r--bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
index 3cd481f4f..2e367a7be 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
@@ -30,7 +30,15 @@ import org.osgi.framework.Bundle;
* DEPTH_INFINITE.
*/
class Win32Monitor extends Job implements IRefreshMonitor {
- private static final long RESCHEDULE_DELAY = 1000;
+ /**
+ * The delay between invocations of the refresh job.
+ */
+ private static final long RESCHEDULE_DELAY = 3000;
+ /**
+ * The time to wait on blocking call to native refresh hook.
+ */
+ private static final int WAIT_FOR_MULTIPLE_OBJECTS_TIMEOUT = 1000;
+ private static final String DEBUG_PREFIX = "Win32RefreshMonitor: "; //$NON-NLS-1$
/**
* A ChainedHandle is a linked list of handles.
@@ -294,8 +302,6 @@ class Win32Monitor extends Job implements IRefreshMonitor {
}
}
- private static final String DEBUG_PREFIX = "Win32RefreshMonitor: "; //$NON-NLS-1$
- private static final int WAIT_FOR_MULTIPLE_OBJECTS_TIMEOUT = 300;
/**
* Any errors that have occurred
*/
@@ -508,8 +514,7 @@ class Win32Monitor extends Job implements IRefreshMonitor {
System.out.println(DEBUG_PREFIX + "job finished in: " + start + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
}
//always reschedule the job - so it will come back after errors or cancelation
- //make sure it doesn't hog more that 5% of CPU
- long delay = Math.max(RESCHEDULE_DELAY, start * 30);
+ long delay = Math.max(RESCHEDULE_DELAY, start);
if (RefreshManager.DEBUG)
System.out.println(DEBUG_PREFIX + "rescheduling in: " + delay / 1000 + " seconds"); //$NON-NLS-1$ //$NON-NLS-2$
final Bundle bundle = Platform.getBundle(ResourcesPlugin.PI_RESOURCES);

Back to the top