SUGGESTED FIX
@@ -205,11 +205,11 @@
bool GenericTaskQueue<E>::push_slow(E t, uint dirty_n_elems) {
if (dirty_n_elems == N - 1) {
// Actually means 0, so do the push.
uint localBot = _bottom;
_elems[localBot] = t;
- _bottom = increment_index(localBot);
+ OrderAccess::release_store(&_bottom, increment_index(localBot));
return true;
}
return false;
}
@@ -483,11 +483,11 @@
idx_t top = _age.top();
uint dirty_n_elems = dirty_size(localBot, top);
assert((dirty_n_elems >= 0) && (dirty_n_elems < N), "n_elems out of range.");
if (dirty_n_elems < max_elems()) {
_elems[localBot] = t;
- _bottom = increment_index(localBot);
+ OrderAccess::release_store(&_bottom, increment_index(localBot));
return true;
} else {
return push_slow(t, dirty_n_elems);
}
#endif
|