• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "common_helper.h"
18 
19 #include "jni.h"
20 #include "jvmti.h"
21 
22 #include "jvmti_helper.h"
23 #include "scoped_local_ref.h"
24 #include "test_env.h"
25 
26 namespace art {
27 namespace common_threads {
28 
Java_art_Threads_interruptThread(JNIEnv * env,jclass,jthread thr)29 extern "C" JNIEXPORT void Java_art_Threads_interruptThread(JNIEnv* env, jclass, jthread thr) {
30   JvmtiErrorToException(env, jvmti_env, jvmti_env->InterruptThread(thr));
31 }
32 
Java_art_Threads_stopThread(JNIEnv * env,jclass,jthread thr,jobject exception)33 extern "C" JNIEXPORT void Java_art_Threads_stopThread(JNIEnv* env,
34                                                       jclass,
35                                                       jthread thr,
36                                                       jobject exception) {
37   JvmtiErrorToException(env, jvmti_env, jvmti_env->StopThread(thr, exception));
38 }
39 
40 }  // namespace common_threads
41 }  // namespace art
42