--- old/src/hotspot/share/services/attachListener.cpp 2019-07-11 08:48:52.766153468 +0900 +++ new/src/hotspot/share/services/attachListener.cpp 2019-07-11 08:48:52.677153371 +0900 @@ -45,7 +45,7 @@ #include "utilities/debug.hpp" #include "utilities/formatBuffer.hpp" -volatile bool AttachListener::_initialized; +volatile AttachListenerState AttachListener::_state = AL_NOT_INITIALIZED; // Implementation of "properties" command. // @@ -372,6 +372,7 @@ "Should already be setup"); if (AttachListener::pd_init() != 0) { + AttachListener::set_state(AL_NOT_INITIALIZED); return; } AttachListener::set_initialized(); @@ -379,6 +380,7 @@ for (;;) { AttachOperation* op = AttachListener::dequeue(); if (op == NULL) { + AttachListener::set_state(AL_NOT_INITIALIZED); return; // dequeue failed or shutdown } @@ -422,6 +424,8 @@ // operation complete - send result and output to client op->complete(res, &st); } + + AttachListener::set_state(AL_NOT_INITIALIZED); } bool AttachListener::has_init_error(TRAPS) { @@ -445,6 +449,7 @@ const char thread_name[] = "Attach Listener"; Handle string = java_lang_String::create_from_str(thread_name, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; } @@ -456,6 +461,7 @@ string, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; } @@ -469,6 +475,7 @@ thread_oop, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; }