97 } 98 } 99 100 ConcurrentG1Refine::~ConcurrentG1Refine() { 101 if (_threads != NULL) { 102 for (int i = 0; i < _n_threads; i++) { 103 delete _threads[i]; 104 } 105 FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads, mtGC); 106 } 107 } 108 109 void ConcurrentG1Refine::threads_do(ThreadClosure *tc) { 110 if (_threads != NULL) { 111 for (int i = 0; i < _n_threads; i++) { 112 tc->do_thread(_threads[i]); 113 } 114 } 115 } 116 117 int ConcurrentG1Refine::thread_num() { 118 int n_threads = (G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads 119 : ParallelGCThreads; 120 return MAX2<int>(n_threads, 1); 121 } 122 123 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { 124 for (int i = 0; i < _n_threads; ++i) { 125 _threads[i]->print_on(st); 126 st->cr(); 127 } 128 } | 97 } 98 } 99 100 ConcurrentG1Refine::~ConcurrentG1Refine() { 101 if (_threads != NULL) { 102 for (int i = 0; i < _n_threads; i++) { 103 delete _threads[i]; 104 } 105 FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads, mtGC); 106 } 107 } 108 109 void ConcurrentG1Refine::threads_do(ThreadClosure *tc) { 110 if (_threads != NULL) { 111 for (int i = 0; i < _n_threads; i++) { 112 tc->do_thread(_threads[i]); 113 } 114 } 115 } 116 117 void ConcurrentG1Refine::worker_threads_do(ThreadClosure * tc) { 118 if (_threads != NULL) { 119 for (int i = 0; i < _n_worker_threads; i++) { 120 tc->do_thread(_threads[i]); 121 } 122 } 123 } 124 125 int ConcurrentG1Refine::thread_num() { 126 int n_threads = (G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads 127 : ParallelGCThreads; 128 return MAX2<int>(n_threads, 1); 129 } 130 131 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { 132 for (int i = 0; i < _n_threads; ++i) { 133 _threads[i]->print_on(st); 134 st->cr(); 135 } 136 } 137 138 ConcurrentG1RefineThread * ConcurrentG1Refine::sampling_thread() const { 139 return _threads[_n_threads - 1]; 140 } |