789 TASKQUEUE_STATS_ONLY(stats.record_pop()); |
789 TASKQUEUE_STATS_ONLY(stats.record_pop()); |
790 return true; |
790 return true; |
791 } else { |
791 } else { |
792 // Otherwise, the queue contained exactly one element; we take the slow |
792 // Otherwise, the queue contained exactly one element; we take the slow |
793 // path. |
793 // path. |
|
794 |
|
795 // The barrier is required to prevent reordering the two reads of _age: |
|
796 // one is the _age.get() below, and the other is _age.top() above the if-stmt. |
|
797 // The algorithm may fail if _age.get() reads an older value than _age.top(). |
|
798 OrderAccess::loadload(); |
794 return pop_local_slow(localBot, _age.get()); |
799 return pop_local_slow(localBot, _age.get()); |
795 } |
800 } |
796 } |
801 } |
797 |
802 |
798 typedef GenericTaskQueue<oop, mtGC> OopTaskQueue; |
803 typedef GenericTaskQueue<oop, mtGC> OopTaskQueue; |