equal
deleted
inserted
replaced
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 |