712 TASKQUEUE_STATS_ONLY(stats.record_pop()); |
712 TASKQUEUE_STATS_ONLY(stats.record_pop()); |
713 return true; |
713 return true; |
714 } else { |
714 } else { |
715 // Otherwise, the queue contained exactly one element; we take the slow |
715 // Otherwise, the queue contained exactly one element; we take the slow |
716 // path. |
716 // path. |
|
717 |
|
718 // The barrier is required to prevent reordering the two reads of _age: |
|
719 // one is the _age.get() below, and the other is _age.top() above the if-stmt. |
|
720 // The algorithm may fail if _age.get() reads an older value than _age.top(). |
|
721 OrderAccess::loadload(); |
717 return pop_local_slow(localBot, _age.get()); |
722 return pop_local_slow(localBot, _age.get()); |
718 } |
723 } |
719 } |
724 } |
720 |
725 |
721 typedef GenericTaskQueue<oop, mtGC> OopTaskQueue; |
726 typedef GenericTaskQueue<oop, mtGC> OopTaskQueue; |