projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make core compile with new js stuff and Task replacement class
[org.ibex.core.git]
/
src
/
org
/
ibex
/
core
/
Scheduler.java
diff --git
a/src/org/ibex/core/Scheduler.java
b/src/org/ibex/core/Scheduler.java
index
e4c85fa
..
8fdb506
100644
(file)
--- a/
src/org/ibex/core/Scheduler.java
+++ b/
src/org/ibex/core/Scheduler.java
@@
-1,5
+1,8
@@
-// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.ibex.util;
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the GNU General Public License version 2 ("the License").
+// You may not use this file except in compliance with the License.
+
+package org.ibex.core;
import java.io.IOException;
import java.io.IOException;
@@
-14,10
+17,10
@@
public class Scheduler {
// Public API Exposed to org.ibex /////////////////////////////////////////////////
private static Scheduler singleton;
// Public API Exposed to org.ibex /////////////////////////////////////////////////
private static Scheduler singleton;
- public static void add(Task t) { Log.debug(Scheduler.class, "scheduling " + t); Scheduler.runnable.append(t); }
+ public static void add(Callable t) { Log.debug(Scheduler.class, "scheduling " + t); Scheduler.runnable.append(t); }
public static void init() { if (singleton == null) (singleton = Platform.getScheduler()).run(); }
public static void init() { if (singleton == null) (singleton = Platform.getScheduler()).run(); }
- private static Task current = null;
+ private static Callable current = null;
private static volatile boolean rendering = false;
private static volatile boolean again = false;
private static volatile boolean rendering = false;
private static volatile boolean again = false;
@@
-48,7
+51,7
@@
public class Scheduler {
/**
* SCHEDULER INVARIANT: all scheduler implementations MUST invoke
/**
* SCHEDULER INVARIANT: all scheduler implementations MUST invoke
- * Surface.renderAll() after performing a Task if no tasks remain
+ * Surface.renderAll() after performing a Callable if no tasks remain
* in the queue. A scheduler may choose to invoke
* Surface.renderAll() more often than that if it so chooses.
*/
* in the queue. A scheduler may choose to invoke
* Surface.renderAll() more often than that if it so chooses.
*/
@@
-61,7
+64,7
@@
public class Scheduler {
protected static Queue runnable = new Queue(50);
public void defaultRun() {
while(true) {
protected static Queue runnable = new Queue(50);
public void defaultRun() {
while(true) {
- current = (Task)runnable.remove(true);
+ current = (Callable)runnable.remove(true);
try {
// FIXME hideous
synchronized(this) {
try {
// FIXME hideous
synchronized(this) {
@@
-76,14
+79,14
@@
public class Scheduler {
}
}
Log.debug(Scheduler.class, "performing " + current);
}
}
Log.debug(Scheduler.class, "performing " + current);
- current.perform();
+ current.run(null);
}
renderAll();
} catch (JSExn e) {
Log.info(Scheduler.class, "a JavaScript thread spawned with ibex.thread() threw an exception:");
Log.info(Scheduler.class,e);
} catch (Exception e) {
}
renderAll();
} catch (JSExn e) {
Log.info(Scheduler.class, "a JavaScript thread spawned with ibex.thread() threw an exception:");
Log.info(Scheduler.class,e);
} catch (Exception e) {
- Log.info(Scheduler.class, "a Task threw an exception which was caught by the scheduler:");
+ Log.info(Scheduler.class, "a Callable threw an exception which was caught by the scheduler:");
Log.info(Scheduler.class, e);
} catch (Throwable t) {
t.printStackTrace();
Log.info(Scheduler.class, e);
} catch (Throwable t) {
t.printStackTrace();