projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003/10/28 10:10:17
[org.ibex.core.git]
/
src
/
org
/
xwt
/
ThreadMessage.java
diff --git
a/src/org/xwt/ThreadMessage.java
b/src/org/xwt/ThreadMessage.java
index
d028642
..
cfd6cb7
100644
(file)
--- a/
src/org/xwt/ThreadMessage.java
+++ b/
src/org/xwt/ThreadMessage.java
@@
-16,6
+16,8
@@
import org.xwt.js.*;
* this invariant.
*/
public class ThreadMessage extends Thread implements Message {
* this invariant.
*/
public class ThreadMessage extends Thread implements Message {
+
+ public static boolean fakeBackground = false;
private volatile static int threadcount = 0;
private volatile static int threadcount = 0;
@@
-53,6
+55,7
@@
public class ThreadMessage extends Thread implements Message {
/** attempts to put this thread into the background to perform a blocking operation; returns false if unable to do so */
public static boolean suspendThread() {
/** attempts to put this thread into the background to perform a blocking operation; returns false if unable to do so */
public static boolean suspendThread() {
+ if (fakeBackground) return true;
// put ourselves in the background
Thread thread = Thread.currentThread();
if (!(thread instanceof ThreadMessage)) {
// put ourselves in the background
Thread thread = Thread.currentThread();
if (!(thread instanceof ThreadMessage)) {
@@
-67,6
+70,7
@@
public class ThreadMessage extends Thread implements Message {
/** re-enqueues this thread */
public static void resumeThread() {
/** re-enqueues this thread */
public static void resumeThread() {
+ if (fakeBackground) return;
ThreadMessage mythread = (ThreadMessage)Thread.currentThread();
Message.Q.add(mythread);
mythread.setPriority(Thread.NORM_PRIORITY);
ThreadMessage mythread = (ThreadMessage)Thread.currentThread();
Message.Q.add(mythread);
mythread.setPriority(Thread.NORM_PRIORITY);