< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp

Print this page
rev 52100 : 8212083: Handle remaining gc/lock native code and fix two strings
Summary:
Reviewed-by:


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include <jni.h>
  25 #include <stdio.h>
  26 #include <time.h>
  27 #include "jni_tools.h"
  28 #include "ExceptionCheckingJniEnv.hpp"

  29 
  30 extern "C" {
  31 
  32 static jfieldID objFieldId = NULL;
  33 
  34 /*
  35  * Class:     nsk_share_gc_lock_jniref_JNIGlobalRefLocker
  36  * Method:    criticalNative
  37  * Signature: (JJ)V
  38  */
  39 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIGlobalRefLocker_criticalNative
  40   (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
  41         ExceptionCheckingJniEnvPtr env(jni_env);
  42 
  43         jobject obj;
  44         jobject gref;
  45         time_t start_time, current_time;
  46 
  47         if (objFieldId == NULL) {
  48                 jclass klass = env->GetObjectClass(o);


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include <jni.h>
  25 #include <stdio.h>
  26 #include <time.h>

  27 #include "ExceptionCheckingJniEnv.hpp"
  28 #include "jni_tools.h"
  29 
  30 extern "C" {
  31 
  32 static jfieldID objFieldId = NULL;
  33 
  34 /*
  35  * Class:     nsk_share_gc_lock_jniref_JNIGlobalRefLocker
  36  * Method:    criticalNative
  37  * Signature: (JJ)V
  38  */
  39 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIGlobalRefLocker_criticalNative
  40   (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
  41         ExceptionCheckingJniEnvPtr env(jni_env);
  42 
  43         jobject obj;
  44         jobject gref;
  45         time_t start_time, current_time;
  46 
  47         if (objFieldId == NULL) {
  48                 jclass klass = env->GetObjectClass(o);
< prev index next >