diff options
Diffstat (limited to 'runtime/native/sun_misc_Unsafe.cc')
| -rw-r--r-- | runtime/native/sun_misc_Unsafe.cc | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/runtime/native/sun_misc_Unsafe.cc b/runtime/native/sun_misc_Unsafe.cc index a739c2d16e..e021b77dae 100644 --- a/runtime/native/sun_misc_Unsafe.cc +++ b/runtime/native/sun_misc_Unsafe.cc @@ -31,10 +31,8 @@ #include "mirror/array.h" #include "mirror/class-inl.h" #include "mirror/object-inl.h" -#include "art_field-inl.h" #include "native_util.h" #include "scoped_fast_native_object_access-inl.h" -#include "well_known_classes.h" namespace art { @@ -506,33 +504,6 @@ static void Unsafe_fullFence(JNIEnv*, jobject) { std::atomic_thread_fence(std::memory_order_seq_cst); } -static void Unsafe_park(JNIEnv* env, jobject, jboolean isAbsolute, jlong time) { - ScopedObjectAccess soa(env); - Thread::Current()->Park(isAbsolute, time); -} - -static void Unsafe_unpark(JNIEnv* env, jobject, jobject jthread) { - art::ScopedFastNativeObjectAccess soa(env); - if (jthread == nullptr || !env->IsInstanceOf(jthread, WellKnownClasses::java_lang_Thread)) { - ThrowIllegalArgumentException("Argument to unpark() was not a Thread"); - return; - } - art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_); - art::Thread* thread = art::Thread::FromManagedThread(soa, jthread); - if (thread != nullptr) { - thread->Unpark(); - } else { - // If thread is null, that means that either the thread is not started yet, - // or the thread has already terminated. Setting the field to true will be - // respected when the thread does start, and is harmless if the thread has - // already terminated. - ArtField* unparked = - jni::DecodeArtField(WellKnownClasses::java_lang_Thread_unparkedBeforeStart); - // JNI must use non transactional mode. - unparked->SetBoolean<false>(soa.Decode<mirror::Object>(jthread), JNI_TRUE); - } -} - static JNINativeMethod gMethods[] = { FAST_NATIVE_METHOD(Unsafe, compareAndSwapInt, "(Ljava/lang/Object;JII)Z"), FAST_NATIVE_METHOD(Unsafe, compareAndSwapLong, "(Ljava/lang/Object;JJJ)Z"), @@ -575,8 +546,6 @@ static JNINativeMethod gMethods[] = { FAST_NATIVE_METHOD(Unsafe, putShort, "(Ljava/lang/Object;JS)V"), FAST_NATIVE_METHOD(Unsafe, putFloat, "(Ljava/lang/Object;JF)V"), FAST_NATIVE_METHOD(Unsafe, putDouble, "(Ljava/lang/Object;JD)V"), - FAST_NATIVE_METHOD(Unsafe, unpark, "(Ljava/lang/Object;)V"), - NATIVE_METHOD(Unsafe, park, "(ZJ)V"), // Each of the getFoo variants are overloaded with a call that operates // directively on a native pointer. |