src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp
changeset 59252 623722a6aeb9
parent 54798 9c18785a13bf
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   144   jint saved_current = _current_index;
   144   jint saved_current = _current_index;
   145   size_t index = (size_t)saved_current;
   145   size_t index = (size_t)saved_current;
   146 
   146 
   147   while(index < num_regions) {
   147   while(index < num_regions) {
   148     if (is_in(index)) {
   148     if (is_in(index)) {
   149       jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current);
   149       jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1));
   150       assert(cur >= (jint)saved_current, "Must move forward");
   150       assert(cur >= (jint)saved_current, "Must move forward");
   151       if (cur == saved_current) {
   151       if (cur == saved_current) {
   152         assert(is_in(index), "Invariant");
   152         assert(is_in(index), "Invariant");
   153         return _heap->get_region(index);
   153         return _heap->get_region(index);
   154       } else {
   154       } else {