< prev index next >
src/share/vm/gc/shared/gcId.cpp
Print this page
*** 51,61 ****
const uint GCId::current_raw() {
return currentNamedthread()->gc_id();
}
size_t GCId::print_prefix(char* buf, size_t len) {
! if (ThreadLocalStorage::is_initialized() && ThreadLocalStorage::thread()->is_Named_thread()) {
uint gc_id = current_raw();
if (gc_id != undefined()) {
int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id);
assert(ret > 0, "Failed to print prefix. Log buffer too small?");
return (size_t)ret;
--- 51,62 ----
const uint GCId::current_raw() {
return currentNamedthread()->gc_id();
}
size_t GCId::print_prefix(char* buf, size_t len) {
! Thread* thread = Thread::current_or_null();
! if (thread != NULL && thread->is_Named_thread()) {
uint gc_id = current_raw();
if (gc_id != undefined()) {
int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id);
assert(ret > 0, "Failed to print prefix. Log buffer too small?");
return (size_t)ret;
< prev index next >