Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private volatile int lineNumber;
- volatile public static ArrayList<CodeString> applicationSourceCode = new ArrayList<CodeString>();
- while (lineNumber < WorkData.applicationSourceCode.size()) {
- if (isLineComplete) {
- isLineComplete = false;
- runOnUiThread(runnable);
- }
- }
- line = WorkData.applicationSourceCode.get(lineNumber);
- ...
- isLineComplete = true;
- lineNumber++;
- public class Analyzer {
- public void verify(ArrayList<String> applicationSourceCode) {
- AtomicInteger line = new AtomicInteger(0);
- while (line.get() < applicationSourceCode.size()) {
- runOnUiThread(applicationSourceCode.get(line.getAndIncrement()));
- }
- }
- private void runOnUiThread(String line) {
- //создаём новый объект Runnable и скармливаем потоку line.
- //не задерживаясь выходим.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement