< prev index next >

src/share/vm/gc/shared/workgroup.hpp

Print this page
rev 11970 : imported patch workgroup_volatiles

@@ -311,13 +311,13 @@
 // A class to manage claiming of subtasks within a group of tasks.  The
 // subtasks will be identified by integer indices, usually elements of an
 // 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
 
   // Set all tasks to unclaimed.

@@ -356,15 +356,15 @@
 // a stack object - is there any reason for it not to be?
 
 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();
 
 public:
   SequentialSubTasksDone() {
< prev index next >