aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-02-10 20:31:48 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-02-10 20:31:48 +0000
commitaaf0766e9f897b2fbce053083d85cb739cb509d2 (patch)
tree893852baae8ef6aa653f36d94ed11d6728aa30ea /libjava/gnu
parentef86eabb6c290a9d77d74d63f2b5041a096841d9 (diff)
downloadgcc-aaf0766e9f897b2fbce053083d85cb739cb509d2.zip
gcc-aaf0766e9f897b2fbce053083d85cb739cb509d2.tar.gz
gcc-aaf0766e9f897b2fbce053083d85cb739cb509d2.tar.bz2
natNativeThread.cc: New file.
* gnu/gcj/jni/natNativeThread.cc: New file. * gnu/gcj/jni/NativeThread.java: New file. * java/lang/Thread.java (data): Now a RawData. * include/jvm.h (_Jv_GetCurrentJNIEnv, _Jv_SetCurrentJNIEnv): Declare. * Makefile.in: Rebuilt. * Makefile.am (java/lang/Thread.h): New target. (ordinary_java_source_files): Added NativeThread.java. (nat_source_files): Added natNativeThread.cc. * java/lang/natThread.cc: Include <jni.h> (struct natThread): Added `jni_env' field. (_Jv_GetCurrentJNIEnv): New function. (_Jv_SetCurrentJNIEnv): Likewise. (initialize_native): Initialize jni_env. Include RawData.h. * jni.cc (ThreadGroupClass): New define. (_Jv_JNI_InvokeFunctions): New structure. (JNI_GetCreatedJavaVMs): New function. (the_vm): New global. (JNI_GetDefaultJavaVMInitArgs): New function. Include NativeThread.h. (NativeThreadClass): New define. (_Jv_JNI_EnsureLocalCapacity): Return JNI_ERR, not -1. (_Jv_JNI_DestroyJavaVM): New function. (_Jv_JNI_AttachCurrentThread): New function. (_Jv_JNI_DetachCurrentThread): New function. (_Jv_JNI_GetEnv): New function. (JNI_CreateJavaVM): New function. (_Jv_JNI_GetJavaVM): New function. (_Jv_JNIFunctions): Added entry for GetJavaVM. * include/jni.h (JavaVMAttachArgs): New structure. (JNI_EDETACHED): New define. (JNI_EVERSION): Likewise. (JavaVM): Define properly. (struct JNIInvokeInterface): New structure. (class _Jv_JavaVM): New class. (JNI_OnLoad, JNI_OnUnload): Declare. (JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM, JNI_GetCreatedJavaVMs): Declare. (JavaVMInitArgs): New typedef. (JavaVMOption): Likewise. (JNI_ERR): New define. (JNI_OK): Likewise. From-SVN: r31901
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/gcj/jni/NativeThread.java28
-rw-r--r--libjava/gnu/gcj/jni/natNativeThread.cc24
2 files changed, 52 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/jni/NativeThread.java b/libjava/gnu/gcj/jni/NativeThread.java
new file mode 100644
index 0000000..9ed6d89
--- /dev/null
+++ b/libjava/gnu/gcj/jni/NativeThread.java
@@ -0,0 +1,28 @@
+// NativeThread.java - Wrapper for attached user threads.
+
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+package gnu.gcj.jni;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date February 9, 2000
+ */
+
+public class NativeThread extends Thread
+{
+ public NativeThread (ThreadGroup g, String name)
+ {
+ super (g, null, name);
+ alive_flag = true;
+ }
+
+ // Call this to mark the thread as finished.
+ public native void finish ();
+}
diff --git a/libjava/gnu/gcj/jni/natNativeThread.cc b/libjava/gnu/gcj/jni/natNativeThread.cc
new file mode 100644
index 0000000..b26c95d
--- /dev/null
+++ b/libjava/gnu/gcj/jni/natNativeThread.cc
@@ -0,0 +1,24 @@
+// natNativeThread.cc - Native side of attached threads.
+
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+// Written by Tom Tromey <tromey@cygnus.com>
+
+#include <config.h>
+
+#include <gcj/cni.h>
+#include <jvm.h>
+#include <gnu/gcj/jni/NativeThread.h>
+#include <java/lang/Thread.h>
+
+void
+gnu::gcj::jni::NativeThread::finish ()
+{
+ finish_ ();
+}