--- a/hotspot/src/share/vm/gc/shared/workgroup.hpp Tue Sep 20 00:34:54 2016 +0000
+++ b/hotspot/src/share/vm/gc/shared/workgroup.hpp Tue Sep 20 11:41:43 2016 +0200
@@ -318,9 +318,9 @@
// enumeration type.
class SubTasksDone: public CHeapObj<mtInternal> {
- uint* _tasks;
+ volatile uint* _tasks;
uint _n_tasks;
- uint _threads_completed;
+ volatile uint _threads_completed;
#ifdef ASSERT
volatile uint _claimed;
#endif
@@ -363,11 +363,11 @@
class SequentialSubTasksDone : public StackObj {
protected:
uint _n_tasks; // Total number of tasks available.
- uint _n_claimed; // Number of tasks claimed.
+ volatile uint _n_claimed; // Number of tasks claimed.
// _n_threads is used to determine when a sub task is done.
// See comments on SubTasksDone::_n_threads
uint _n_threads; // Total number of parallel threads.
- uint _n_completed; // Number of completed threads.
+ volatile uint _n_completed; // Number of completed threads.
void clear();