< prev index next >

src/share/vm/gc_implementation/g1/ptrQueue.hpp

Print this page




 226   bool _all_active;
 227 
 228   // If true, notify_all on _cbl_mon when the threshold is reached.
 229   bool _notify_when_complete;
 230 
 231   // Maximum number of elements allowed on completed queue: after that,
 232   // enqueuer does the work itself.  Zero indicates no maximum.
 233   int _max_completed_queue;
 234   int _completed_queue_padding;
 235 
 236   int completed_buffers_list_length();
 237   void assert_completed_buffer_list_len_correct_locked();
 238   void assert_completed_buffer_list_len_correct();
 239 
 240 protected:
 241   // A mutator thread does the the work of processing a buffer.
 242   // Returns "true" iff the work is complete (and the buffer may be
 243   // deallocated).
 244   virtual bool mut_process_buffer(void** buf) {
 245     ShouldNotReachHere();
 246     return false;
 247   }
 248 
 249 public:
 250   // Create an empty ptr queue set.
 251   PtrQueueSet(bool notify_when_complete = false);
 252 
 253   // Because of init-order concerns, we can't pass these as constructor
 254   // arguments.
 255   void initialize(Monitor* cbl_mon, Mutex* fl_lock,
 256                   int process_completed_threshold,
 257                   int max_completed_queue,
 258                   PtrQueueSet *fl_owner = NULL) {
 259     _max_completed_queue = max_completed_queue;
 260     _process_completed_threshold = process_completed_threshold;
 261     _completed_queue_padding = 0;
 262     assert(cbl_mon != NULL && fl_lock != NULL, "Init order issue?");
 263     _cbl_mon = cbl_mon;
 264     _fl_lock = fl_lock;
 265     _fl_owner = (fl_owner != NULL) ? fl_owner : this;
 266   }




 226   bool _all_active;
 227 
 228   // If true, notify_all on _cbl_mon when the threshold is reached.
 229   bool _notify_when_complete;
 230 
 231   // Maximum number of elements allowed on completed queue: after that,
 232   // enqueuer does the work itself.  Zero indicates no maximum.
 233   int _max_completed_queue;
 234   int _completed_queue_padding;
 235 
 236   int completed_buffers_list_length();
 237   void assert_completed_buffer_list_len_correct_locked();
 238   void assert_completed_buffer_list_len_correct();
 239 
 240 protected:
 241   // A mutator thread does the the work of processing a buffer.
 242   // Returns "true" iff the work is complete (and the buffer may be
 243   // deallocated).
 244   virtual bool mut_process_buffer(void** buf) {
 245     ShouldNotReachHere();

 246   }
 247 
 248 public:
 249   // Create an empty ptr queue set.
 250   PtrQueueSet(bool notify_when_complete = false);
 251 
 252   // Because of init-order concerns, we can't pass these as constructor
 253   // arguments.
 254   void initialize(Monitor* cbl_mon, Mutex* fl_lock,
 255                   int process_completed_threshold,
 256                   int max_completed_queue,
 257                   PtrQueueSet *fl_owner = NULL) {
 258     _max_completed_queue = max_completed_queue;
 259     _process_completed_threshold = process_completed_threshold;
 260     _completed_queue_padding = 0;
 261     assert(cbl_mon != NULL && fl_lock != NULL, "Init order issue?");
 262     _cbl_mon = cbl_mon;
 263     _fl_lock = fl_lock;
 264     _fl_owner = (fl_owner != NULL) ? fl_owner : this;
 265   }


< prev index next >