8073464: GC workers do not have thread names
Reviewed-by: brutisso, tschatzl
This commit is contained in:
parent
40d3986051
commit
a827cdfa10
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -97,9 +97,7 @@ ConcurrentMarkSweepThread::ConcurrentMarkSweepThread(CMSCollector* collector)
|
|||||||
void ConcurrentMarkSweepThread::run() {
|
void ConcurrentMarkSweepThread::run() {
|
||||||
assert(this == cmst(), "just checking");
|
assert(this == cmst(), "just checking");
|
||||||
|
|
||||||
this->record_stack_base_and_size();
|
initialize_in_thread();
|
||||||
this->initialize_thread_local_storage();
|
|
||||||
this->set_active_handles(JNIHandleBlock::allocate_block());
|
|
||||||
// From this time Thread::current() should be working.
|
// From this time Thread::current() should be working.
|
||||||
assert(this == Thread::current(), "just checking");
|
assert(this == Thread::current(), "just checking");
|
||||||
if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
|
if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -98,6 +98,7 @@ void GCTaskThread::run() {
|
|||||||
// Set up the thread for stack overflow support
|
// Set up the thread for stack overflow support
|
||||||
this->record_stack_base_and_size();
|
this->record_stack_base_and_size();
|
||||||
this->initialize_thread_local_storage();
|
this->initialize_thread_local_storage();
|
||||||
|
this->initialize_named_thread();
|
||||||
// Bind yourself to your processor.
|
// Bind yourself to your processor.
|
||||||
if (processor_id() != GCTaskManager::sentinel_worker()) {
|
if (processor_id() != GCTaskManager::sentinel_worker()) {
|
||||||
if (TraceGCTaskThread) {
|
if (TraceGCTaskThread) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -56,6 +56,7 @@ void ConcurrentGCThread::create_and_start() {
|
|||||||
void ConcurrentGCThread::initialize_in_thread() {
|
void ConcurrentGCThread::initialize_in_thread() {
|
||||||
this->record_stack_base_and_size();
|
this->record_stack_base_and_size();
|
||||||
this->initialize_thread_local_storage();
|
this->initialize_thread_local_storage();
|
||||||
|
this->initialize_named_thread();
|
||||||
this->set_active_handles(JNIHandleBlock::allocate_block());
|
this->set_active_handles(JNIHandleBlock::allocate_block());
|
||||||
// From this time Thread::current() should be working.
|
// From this time Thread::current() should be working.
|
||||||
assert(this == Thread::current(), "just checking");
|
assert(this == Thread::current(), "just checking");
|
||||||
|
@ -1161,6 +1161,10 @@ void NamedThread::set_name(const char* format, ...) {
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NamedThread::initialize_named_thread() {
|
||||||
|
set_native_thread_name(name());
|
||||||
|
}
|
||||||
|
|
||||||
void NamedThread::print_on(outputStream* st) const {
|
void NamedThread::print_on(outputStream* st) const {
|
||||||
st->print("\"%s\" ", name());
|
st->print("\"%s\" ", name());
|
||||||
Thread::print_on(st);
|
Thread::print_on(st);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -667,6 +667,7 @@ class NamedThread: public Thread {
|
|||||||
~NamedThread();
|
~NamedThread();
|
||||||
// May only be called once per thread.
|
// May only be called once per thread.
|
||||||
void set_name(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
void set_name(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
||||||
|
void initialize_named_thread();
|
||||||
virtual bool is_Named_thread() const { return true; }
|
virtual bool is_Named_thread() const { return true; }
|
||||||
virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
|
virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
|
||||||
JavaThread *processed_thread() { return _processed_thread; }
|
JavaThread *processed_thread() { return _processed_thread; }
|
||||||
|
@ -243,7 +243,7 @@ void VMThread::run() {
|
|||||||
assert(this == vm_thread(), "check");
|
assert(this == vm_thread(), "check");
|
||||||
|
|
||||||
this->initialize_thread_local_storage();
|
this->initialize_thread_local_storage();
|
||||||
this->set_native_thread_name(this->name());
|
this->initialize_named_thread();
|
||||||
this->record_stack_base_and_size();
|
this->record_stack_base_and_size();
|
||||||
// Notify_lock wait checks on active_handles() to rewait in
|
// Notify_lock wait checks on active_handles() to rewait in
|
||||||
// case of spurious wakeup, it should wait on the last
|
// case of spurious wakeup, it should wait on the last
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -247,6 +247,7 @@ void GangWorker::run() {
|
|||||||
void GangWorker::initialize() {
|
void GangWorker::initialize() {
|
||||||
this->initialize_thread_local_storage();
|
this->initialize_thread_local_storage();
|
||||||
this->record_stack_base_and_size();
|
this->record_stack_base_and_size();
|
||||||
|
this->initialize_named_thread();
|
||||||
assert(_gang != NULL, "No gang to run in");
|
assert(_gang != NULL, "No gang to run in");
|
||||||
os::set_priority(this, NearMaxPriority);
|
os::set_priority(this, NearMaxPriority);
|
||||||
if (TraceWorkGang) {
|
if (TraceWorkGang) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user