From aaf0766e9f897b2fbce053083d85cb739cb509d2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 10 Feb 2000 20:31:48 +0000 Subject: 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 (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 --- libjava/gnu/gcj/jni/NativeThread.java | 28 ++++++++++++++++++++++++++++ libjava/gnu/gcj/jni/natNativeThread.cc | 24 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 libjava/gnu/gcj/jni/NativeThread.java create mode 100644 libjava/gnu/gcj/jni/natNativeThread.cc (limited to 'libjava/gnu') 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 + * @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 + +#include + +#include +#include +#include +#include + +void +gnu::gcj::jni::NativeThread::finish () +{ + finish_ (); +} -- cgit v1.1