summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-13 20:26:38 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-13 20:26:38 +0000
commita4d0c85c994d67b789c3a3d7a679298598458b2e (patch)
tree769a55086c50415cd41df07dada0589ffcf265ba
parent6b35f24cf5d56f4d9d25a4c40ddc671a5cac7427 (diff)
downloadgcc-a4d0c85c994d67b789c3a3d7a679298598458b2e.tar.gz
2005-01-13 Michael Koch <konqueror@gmx.de>
PR libgcj/17784 * java/lang/Thread.java (Thread): Call checkAccess(). (stop): Fixed argument name to match javadoc. * java/lang/natThread.cc (interrupt): Call checkAccess(). (stop): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93611 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog10
-rw-r--r--libjava/java/lang/Thread.java8
-rw-r--r--libjava/java/lang/natThread.cc2
3 files changed, 18 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 918f99f087d..151ee652554 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,13 @@
+2005-01-13 Michael Koch <konqueror@gmx.de>
+
+ PR libgcj/17784
+ * java/lang/Thread.java
+ (Thread): Call checkAccess().
+ (stop): Fixed argument name to match javadoc.
+ * java/lang/natThread.cc
+ (interrupt): Call checkAccess().
+ (stop): Likewise.
+
2005-01-11 Michael Koch <konqueror@gmx.de>
PR libgcj/13972
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java
index 5f3940f8462..ef4a3f472f0 100644
--- a/libjava/java/lang/Thread.java
+++ b/libjava/java/lang/Thread.java
@@ -1,5 +1,5 @@
/* Thread -- an independent thread of executable code
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation
This file is part of GNU Classpath.
@@ -36,6 +36,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.lang;
import gnu.gcj.RawData;
@@ -321,6 +322,9 @@ public class Thread implements Runnable
private Thread (Thread current, ThreadGroup g, Runnable r, String n)
{
+ // Make sure the current thread may create a new thread.
+ checkAccess();
+
// The Class Libraries book says ``threadName cannot be null''. I
// take this to mean NullPointerException.
if (n == null)
@@ -862,7 +866,7 @@ public class Thread implements Runnable
* @see SecurityManager#checkPermission(Permission)
* @deprecated unsafe operation, try not to use
*/
- public final native void stop(Throwable e);
+ public final native void stop(Throwable t);
/**
* Suspend this Thread. It will not come back, ever, unless it is resumed.
diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc
index 4782115d2cf..af33b0db353 100644
--- a/libjava/java/lang/natThread.cc
+++ b/libjava/java/lang/natThread.cc
@@ -112,6 +112,7 @@ java::lang::Thread::holdsLock (jobject obj)
void
java::lang::Thread::interrupt (void)
{
+ checkAccess ();
natThread *nt = (natThread *) data;
_Jv_ThreadInterrupt (nt->thread);
}
@@ -321,6 +322,7 @@ java::lang::Thread::start (void)
void
java::lang::Thread::stop (java::lang::Throwable *)
{
+ checkAccess ();
throw new UnsupportedOperationException
(JvNewStringLatin1 ("Thread.stop unimplemented"));
}