MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / run

Method run

CodenameOne/src/com/codename1/ui/Display.java:857–878  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

855 if (backgroundThread == null) {
856 backgroundThread = new CodenameOneThread(new Runnable() {
857 @Override
858 public void run() {
859 // using while true to avoid double lock optimization with synchronized block
860 while (true) {
861 Runnable nextTask = null;
862 synchronized (lock) {
863 if (!backgroundTasks.isEmpty()) {
864 nextTask = backgroundTasks.get(0);
865 } else {
866 backgroundThread = null;
867 return;
868 }
869 backgroundTasks.remove(0);
870 }
871 try {
872 executeBackgroundTaskRunnable(nextTask);
873 } catch (Throwable e) {
874 Log.e(e);
875 }
876 Util.sleep(10);
877 }
878 }
879 }, "Task Thread");
880 backgroundThread.setPriority(Thread.MIN_PRIORITY + 1);
881 backgroundThread.start();

Callers

nothing calls this directly

Calls 12

eMethod · 0.95
sleepMethod · 0.95
onEditingCompleteMethod · 0.95
getInstanceMethod · 0.95
isEmptyMethod · 0.65
getMethod · 0.65
removeMethod · 0.65
onResultMethod · 0.65
hasListenersMethod · 0.45
fireActionEventMethod · 0.45

Tested by

no test coverage detected