Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java

Issue 135803003: Translate index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java
index d0e6f1cde48bc3d640f95f118e8c96967cab6571..de5b514274a6918f49b3a1b3b5e3ef77fa25718f 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationProcessor.java
@@ -122,11 +122,11 @@ public class OperationProcessor {
/**
* Stop processing operations after the current operation has completed. If the argument is
- * {@code true} then this method will wait until the last operation has completed; otherwise
- * this method might return before the last operation has completed.
+ * {@code true} then this method will wait until the last operation has completed; otherwise this
+ * method might return before the last operation has completed.
*
- * @param wait {@code true} if this method will wait until the last operation has completed
- * before returning
+ * @param wait {@code true} if this method will wait until the last operation has completed before
+ * returning
* @return the library files for the libraries that need to be analyzed when a new session is
* started.
*/
@@ -147,7 +147,7 @@ public class OperationProcessor {
return getUnanalyzedSources();
}
}
- Uninterruptibles.sleepUninterruptibly(1, TimeUnit.MILLISECONDS);
+ waitOneMs();
}
return getUnanalyzedSources();
}
@@ -155,12 +155,12 @@ public class OperationProcessor {
/**
* Waits until processors will switch from "ready" to "running" state.
*
- * @return {@code true} if processor is now actually in "running" state, e.g. not in
- * "stopped" state.
+ * @return {@code true} if processor is now actually in "running" state, e.g. not in "stopped"
+ * state.
*/
public boolean waitForRunning() {
while (state == ProcessorState.READY) {
- Thread.yield();
+ threadYield();
}
return state == ProcessorState.RUNNING;
}
@@ -189,4 +189,12 @@ public class OperationProcessor {
return state == ProcessorState.RUNNING;
}
}
+
+ private void threadYield() {
+ Thread.yield();
+ }
+
+ private void waitOneMs() {
+ Uninterruptibles.sleepUninterruptibly(1, TimeUnit.MILLISECONDS);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698