src/hotspot/share/prims/jni.cpp
changeset 59252 623722a6aeb9
parent 59251 4cbfa5077d68
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   271 
   271 
   272   JNIHistogramElement::JNIHistogramElement(const char* elementName) {
   272   JNIHistogramElement::JNIHistogramElement(const char* elementName) {
   273     _name = elementName;
   273     _name = elementName;
   274     uintx count = 0;
   274     uintx count = 0;
   275 
   275 
   276     while (Atomic::cmpxchg(1, &JNIHistogram_lock, 0) != 0) {
   276     while (Atomic::cmpxchg(&JNIHistogram_lock, 0, 1) != 0) {
   277       while (Atomic::load_acquire(&JNIHistogram_lock) != 0) {
   277       while (Atomic::load_acquire(&JNIHistogram_lock) != 0) {
   278         count +=1;
   278         count +=1;
   279         if ( (WarnOnStalledSpinLock > 0)
   279         if ( (WarnOnStalledSpinLock > 0)
   280           && (count % WarnOnStalledSpinLock == 0)) {
   280           && (count % WarnOnStalledSpinLock == 0)) {
   281           warning("JNIHistogram_lock seems to be stalled");
   281           warning("JNIHistogram_lock seems to be stalled");
  3231 static bool initializeDirectBufferSupport(JNIEnv* env, JavaThread* thread) {
  3231 static bool initializeDirectBufferSupport(JNIEnv* env, JavaThread* thread) {
  3232   if (directBufferSupportInitializeFailed) {
  3232   if (directBufferSupportInitializeFailed) {
  3233     return false;
  3233     return false;
  3234   }
  3234   }
  3235 
  3235 
  3236   if (Atomic::cmpxchg(1, &directBufferSupportInitializeStarted, 0) == 0) {
  3236   if (Atomic::cmpxchg(&directBufferSupportInitializeStarted, 0, 1) == 0) {
  3237     if (!lookupDirectBufferClasses(env)) {
  3237     if (!lookupDirectBufferClasses(env)) {
  3238       directBufferSupportInitializeFailed = 1;
  3238       directBufferSupportInitializeFailed = 1;
  3239       return false;
  3239       return false;
  3240     }
  3240     }
  3241 
  3241