< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page
*** 80,10 ***
--- 80,13 ---
  #include "runtime/vmOperations.hpp"
  #include "runtime/vm_version.hpp"
  #include "services/attachListener.hpp"
  #include "services/management.hpp"
  #include "services/threadService.hpp"
+ #if INCLUDE_TSAN
+ #include "tsan/tsan.hpp"
+ #endif  // INCLUDE_TSAN
  #include "utilities/copy.hpp"
  #include "utilities/defaultStream.hpp"
  #include "utilities/dtrace.hpp"
  #include "utilities/events.hpp"
  #include "utilities/histogram.hpp"

*** 3201,10 ***
--- 3204,19 ---
    objArrayOop result = ClassLoader::get_system_packages(CHECK_NULL);
    return (jobjectArray) JNIHandles::make_local(result);
  JVM_END
  
  
+ // java.lang.ref.Finalizer ///////////////////////////////////////////////////////////////
+ 
+ JVM_ENTRY(jboolean, JVM_GetTsanEnabled(JNIEnv *env))
+   JVMWrapper("JVM_GetTsanEnabled");
+   TSAN_ONLY(return ThreadSanitizer;)
+   NOT_TSAN(return JNI_FALSE;)
+ JVM_END
+ 
+ 
  // java.lang.ref.Reference ///////////////////////////////////////////////////////////////
  
  
  JVM_ENTRY(jobject, JVM_GetAndClearReferencePendingList(JNIEnv* env))
    JVMWrapper("JVM_GetAndClearReferencePendingList");

*** 3423,32 ***
  
  
  JNIEXPORT void* JNICALL JVM_RawMonitorCreate(void) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorCreate");
!   return new os::PlatformMutex();
  }
  
  
  JNIEXPORT void JNICALL  JVM_RawMonitorDestroy(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorDestroy");
    delete ((os::PlatformMutex*) mon);
  }
  
  
  JNIEXPORT jint JNICALL JVM_RawMonitorEnter(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorEnter");
    ((os::PlatformMutex*) mon)->lock();
    return 0;
  }
  
  
  JNIEXPORT void JNICALL JVM_RawMonitorExit(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorExit");
    ((os::PlatformMutex*) mon)->unlock();
  }
  
  
  // Shared JNI/JVM entry points //////////////////////////////////////////////////////////////
--- 3435,37 ---
  
  
  JNIEXPORT void* JNICALL JVM_RawMonitorCreate(void) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorCreate");
!   void *mon = new os::PlatformMutex();
+   TSAN_RUNTIME_ONLY(TSAN_RAW_LOCK_CREATE(mon));
+   return mon;
  }
  
  
  JNIEXPORT void JNICALL  JVM_RawMonitorDestroy(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorDestroy");
+   TSAN_RUNTIME_ONLY(TSAN_RAW_LOCK_DESTROY(mon));
    delete ((os::PlatformMutex*) mon);
  }
  
  
  JNIEXPORT jint JNICALL JVM_RawMonitorEnter(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorEnter");
    ((os::PlatformMutex*) mon)->lock();
+   TSAN_RUNTIME_ONLY(TSAN_RAW_LOCK_ACQUIRED(mon));
    return 0;
  }
  
  
  JNIEXPORT void JNICALL JVM_RawMonitorExit(void *mon) {
    VM_Exit::block_if_vm_exited();
    JVMWrapper("JVM_RawMonitorExit");
+   TSAN_RUNTIME_ONLY(TSAN_RAW_LOCK_RELEASED(mon));
    ((os::PlatformMutex*) mon)->unlock();
  }
  
  
  // Shared JNI/JVM entry points //////////////////////////////////////////////////////////////
< prev index next >