src/hotspot/share/gc/z/zArray.inline.hpp
changeset 59249 29b0d0b61615
parent 58707 810409af12f1
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
    99     _next(0) {}
    99     _next(0) {}
   100 
   100 
   101 template <typename T, bool parallel>
   101 template <typename T, bool parallel>
   102 inline bool ZArrayIteratorImpl<T, parallel>::next(T* elem) {
   102 inline bool ZArrayIteratorImpl<T, parallel>::next(T* elem) {
   103   if (parallel) {
   103   if (parallel) {
   104     const size_t next = Atomic::add(1u, &_next) - 1u;
   104     const size_t next = Atomic::add(&_next, 1u) - 1u;
   105     if (next < _array->size()) {
   105     if (next < _array->size()) {
   106       *elem = _array->at(next);
   106       *elem = _array->at(next);
   107       return true;
   107       return true;
   108     }
   108     }
   109   } else {
   109   } else {