8144702: Using tid decorator in Unified Logging may crash VM
Summary: LogDecorations::create_tid_decoration should avoid Thread::current() if possible.
Reviewed-by: mlarsson, coleenp
--- a/hotspot/src/share/vm/logging/logDecorations.cpp Sat Dec 05 03:10:50 2015 +0000
+++ b/hotspot/src/share/vm/logging/logDecorations.cpp Sat Dec 05 07:16:52 2015 +0100
@@ -96,7 +96,7 @@
char * LogDecorations::create_tid_decoration(char* pos) {
int written = jio_snprintf(pos, DecorationsBufferSize - (pos - _decorations_buffer),
- INTX_FORMAT, Thread::current()->osthread()->thread_id());
+ INTX_FORMAT, os::current_thread_id());
ASSERT_AND_RETURN(written, pos)
}