src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp
changeset 59252 623722a6aeb9
parent 53383 5dc89efc08f0
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    95   jint saved_current = _current_index;
    95   jint saved_current = _current_index;
    96   size_t index = (size_t)saved_current;
    96   size_t index = (size_t)saved_current;
    97 
    97 
    98   while(index < num_regions) {
    98   while(index < num_regions) {
    99     if (_set->is_in(index)) {
    99     if (_set->is_in(index)) {
   100       jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current);
   100       jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1));
   101       assert(cur >= (jint)saved_current, "Must move forward");
   101       assert(cur >= (jint)saved_current, "Must move forward");
   102       if (cur == saved_current) {
   102       if (cur == saved_current) {
   103         assert(_set->is_in(index), "Invariant");
   103         assert(_set->is_in(index), "Invariant");
   104         return _heap->get_region(index);
   104         return _heap->get_region(index);
   105       } else {
   105       } else {