diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-06-29 20:44:43 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-06-29 20:44:43 +0000 |
commit | c0bd460c3f791794340979c78055f70e63f4111b (patch) | |
tree | d827d22a1db29e24fc38c51a16834a4491337078 | |
parent | c608e01d88022c7604a3901717a279237e418ca0 (diff) | |
download | classpath-c0bd460c3f791794340979c78055f70e63f4111b.tar.gz |
2006-06-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/lang/Thread.java,
* java/lang/VMThread.java:
Reverted patch from 2006-06-28.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | java/lang/Thread.java | 35 | ||||
-rw-r--r-- | vm/reference/java/lang/VMThread.java | 5 |
3 files changed, 11 insertions, 35 deletions
@@ -1,3 +1,9 @@ +2006-06-29 Andrew John Hughes <gnu_andrew@member.fsf.org> + + * java/lang/Thread.java, + * java/lang/VMThread.java: + Reverted patch from 2006-06-28. + 2006-06-29 Roman Kennke <kennke@aicas.com> * gnu/java/awt/peer/x/GLGraphics.java, diff --git a/java/lang/Thread.java b/java/lang/Thread.java index 34da4373f..c1a07047c 100644 --- a/java/lang/Thread.java +++ b/java/lang/Thread.java @@ -131,9 +131,6 @@ public class Thread implements Runnable /** The thread priority, 1 to 10. */ volatile int priority; - /** The current thread state. */ - volatile String state; - /** Native thread stack size. 0 = use default */ private long stacksize; @@ -375,7 +372,6 @@ public class Thread implements Runnable priority = current.priority; daemon = current.daemon; - state = "NEW"; contextClassLoader = current.contextClassLoader; contextClassLoaderIsSystemClassLoader = current.contextClassLoaderIsSystemClassLoader; @@ -406,7 +402,6 @@ public class Thread implements Runnable this.name = name; this.priority = priority; this.daemon = daemon; - state = "NEW"; // By default the context class loader is the system class loader, // we set a flag to signal this because we don't want to call // ClassLoader.getSystemClassLoader() at this point, because on @@ -711,13 +706,7 @@ public class Thread implements Runnable VMThread t = vmThread; if(t != null) - { - if(ms == 0 && ns == 0) - state = "WAITING"; - else - state = "TIMED_WAITING"; - t.join(ms, ns); - } + t.join(ms, ns); } /** @@ -735,10 +724,7 @@ public class Thread implements Runnable checkAccess(); VMThread t = vmThread; if (t != null) - { - state = "RUNNABLE"; t.resume(); - } } /** @@ -864,7 +850,7 @@ public class Thread implements Runnable * are no guarantees which thread will be next to run, but most VMs will * choose the highest priority thread that has been waiting longest. * - * @param ms the number of milliseconds to sleep5~. + * @param ms the number of milliseconds to sleep. * @throws InterruptedException if the Thread is (or was) interrupted; * it's <i>interrupted status</i> will be cleared * @throws IllegalArgumentException if ms is negative @@ -906,11 +892,6 @@ public class Thread implements Runnable if (ns < 0 || ns > 999999) throw new IllegalArgumentException("Nanoseconds ouf of range: " + ns); - if (ms == 0 && ns == 0) - currentThread().state = "WAITING"; - else - currentThread().state = "TIMED_WAITING"; - // Really sleep VMThread.sleep(ms, ns); } @@ -930,7 +911,6 @@ public class Thread implements Runnable if (vmThread != null || group == null) throw new IllegalThreadStateException(); - state = "RUNNABLE"; VMThread.create(this, stacksize); } @@ -1004,10 +984,7 @@ public class Thread implements Runnable } VMThread vt = vmThread; if (vt != null) - { - state = "TERMINATED"; vt.stop(t); - } else stillborn = t; } @@ -1029,10 +1006,7 @@ public class Thread implements Runnable checkAccess(); VMThread t = vmThread; if (t != null) - { - state = "WAITING"; t.suspend(); - } } /** @@ -1084,7 +1058,6 @@ public class Thread implements Runnable group.removeThread(this); vmThread = null; locals = null; - state = "TERMINATED"; } /** @@ -1266,7 +1239,7 @@ public class Thread implements Runnable public String getState() { VMThread t = vmThread; - return t == null ? state : t.getState(); + return t == null ? null : t.getState(); } /** @@ -1365,5 +1338,5 @@ public class Thread implements Runnable ThreadInfo info = bean.getThreadInfo(threadId, Integer.MAX_VALUE); return info.getStackTrace(); } - + } diff --git a/vm/reference/java/lang/VMThread.java b/vm/reference/java/lang/VMThread.java index 1ea3a6169..ff0ec6878 100644 --- a/vm/reference/java/lang/VMThread.java +++ b/vm/reference/java/lang/VMThread.java @@ -456,9 +456,6 @@ final class VMThread * @return a string corresponding to one of the * thread enumeration states specified above. */ - String getState() - { - return thread.state; - } + native String getState(); } |