219 uint num_thr = total_workers();
220 for (uint i = 0; i < num_thr; i++) {
221 gang_worker(i)->print_on(st);
222 st->cr();
223 }
224 }
225
226 void AbstractWorkGang::threads_do(ThreadClosure* tc) const {
227 assert(tc != NULL, "Null ThreadClosure");
228 uint num_thr = total_workers();
229 for (uint i = 0; i < num_thr; i++) {
230 tc->do_thread(gang_worker(i));
231 }
232 }
233
234 // GangWorker methods.
235
236 GangWorker::GangWorker(AbstractWorkGang* gang, uint id) {
237 _gang = gang;
238 set_id(id);
239 set_name("Gang worker#%d (%s)", id, gang->name());
240 }
241
242 void GangWorker::run() {
243 initialize();
244 loop();
245 }
246
247 void GangWorker::initialize() {
248 this->initialize_thread_local_storage();
249 this->record_stack_base_and_size();
250 this->initialize_named_thread();
251 assert(_gang != NULL, "No gang to run in");
252 os::set_priority(this, NearMaxPriority);
253 if (TraceWorkGang) {
254 tty->print_cr("Running gang worker for gang %s id %d",
255 gang()->name(), id());
256 }
257 // The VM thread should not execute here because MutexLocker's are used
258 // as (opposed to MutexLockerEx's).
259 assert(!Thread::current()->is_VM_thread(), "VM thread should not be part"
|
219 uint num_thr = total_workers();
220 for (uint i = 0; i < num_thr; i++) {
221 gang_worker(i)->print_on(st);
222 st->cr();
223 }
224 }
225
226 void AbstractWorkGang::threads_do(ThreadClosure* tc) const {
227 assert(tc != NULL, "Null ThreadClosure");
228 uint num_thr = total_workers();
229 for (uint i = 0; i < num_thr; i++) {
230 tc->do_thread(gang_worker(i));
231 }
232 }
233
234 // GangWorker methods.
235
236 GangWorker::GangWorker(AbstractWorkGang* gang, uint id) {
237 _gang = gang;
238 set_id(id);
239 set_name("%s#%d", gang->name(), id);
240 }
241
242 void GangWorker::run() {
243 initialize();
244 loop();
245 }
246
247 void GangWorker::initialize() {
248 this->initialize_thread_local_storage();
249 this->record_stack_base_and_size();
250 this->initialize_named_thread();
251 assert(_gang != NULL, "No gang to run in");
252 os::set_priority(this, NearMaxPriority);
253 if (TraceWorkGang) {
254 tty->print_cr("Running gang worker for gang %s id %d",
255 gang()->name(), id());
256 }
257 // The VM thread should not execute here because MutexLocker's are used
258 // as (opposed to MutexLockerEx's).
259 assert(!Thread::current()->is_VM_thread(), "VM thread should not be part"
|