< prev index next >

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

Print this page
rev 11508 : 8157240: GC task trace logging is incomprehensible
Reviewed-by: tschatzl
rev 11509 : [mq]: code_review1


  62 
  63   os::ThreadType worker_type;
  64   if (are_ConcurrentGC_threads()) {
  65     worker_type = os::cgc_thread;
  66   } else {
  67     worker_type = os::pgc_thread;
  68   }
  69   uint previous_created_workers = _created_workers;
  70 
  71   _created_workers = WorkerManager::add_workers(this,
  72                                                 active_workers,
  73                                                 _total_workers,
  74                                                 _created_workers,
  75                                                 worker_type,
  76                                                 initializing);
  77   _active_workers = MIN2(_created_workers, _active_workers);
  78 
  79   WorkerManager::log_worker_creation(this, previous_created_workers, _active_workers, _created_workers, initializing);
  80 }
  81 
  82 char* AbstractWorkGang::worker_name(uint which) {
  83   if (worker(which) != NULL) {
  84     return worker(which)->name();
  85   } else {
  86     return NULL;
  87   }
  88 }
  89 
  90 AbstractGangWorker* AbstractWorkGang::worker(uint i) const {
  91   // Array index bounds checking.
  92   AbstractGangWorker* result = NULL;
  93   assert(_workers != NULL, "No workers for indexing");
  94   assert(i < total_workers(), "Worker index out of bounds");
  95   result = _workers[i];
  96   assert(result != NULL, "Indexing to null worker");
  97   return result;
  98 }
  99 
 100 void AbstractWorkGang::print_worker_threads_on(outputStream* st) const {
 101   uint workers = created_workers();
 102   for (uint i = 0; i < workers; i++) {
 103     worker(i)->print_on(st);
 104     st->cr();
 105   }
 106 }
 107 
 108 void AbstractWorkGang::threads_do(ThreadClosure* tc) const {
 109   assert(tc != NULL, "Null ThreadClosure");




  62 
  63   os::ThreadType worker_type;
  64   if (are_ConcurrentGC_threads()) {
  65     worker_type = os::cgc_thread;
  66   } else {
  67     worker_type = os::pgc_thread;
  68   }
  69   uint previous_created_workers = _created_workers;
  70 
  71   _created_workers = WorkerManager::add_workers(this,
  72                                                 active_workers,
  73                                                 _total_workers,
  74                                                 _created_workers,
  75                                                 worker_type,
  76                                                 initializing);
  77   _active_workers = MIN2(_created_workers, _active_workers);
  78 
  79   WorkerManager::log_worker_creation(this, previous_created_workers, _active_workers, _created_workers, initializing);
  80 }
  81 








  82 AbstractGangWorker* AbstractWorkGang::worker(uint i) const {
  83   // Array index bounds checking.
  84   AbstractGangWorker* result = NULL;
  85   assert(_workers != NULL, "No workers for indexing");
  86   assert(i < total_workers(), "Worker index out of bounds");
  87   result = _workers[i];
  88   assert(result != NULL, "Indexing to null worker");
  89   return result;
  90 }
  91 
  92 void AbstractWorkGang::print_worker_threads_on(outputStream* st) const {
  93   uint workers = created_workers();
  94   for (uint i = 0; i < workers; i++) {
  95     worker(i)->print_on(st);
  96     st->cr();
  97   }
  98 }
  99 
 100 void AbstractWorkGang::threads_do(ThreadClosure* tc) const {
 101   assert(tc != NULL, "Null ThreadClosure");


< prev index next >