< prev index next >

src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp

Print this page

        

@@ -91,11 +91,11 @@
 
 static volatile int _lock = 0;
 
 ObjectSampler* ObjectSampler::acquire() {
   assert(is_created(), "invariant");
-  while (Atomic::cmpxchg(1, &_lock, 0) == 1) {}
+  while (Atomic::cmpxchg(&_lock, 0, 1) == 1) {}
   return _instance;
 }
 
 void ObjectSampler::release() {
   assert(is_created(), "invariant");
< prev index next >