< prev index next >
src/hotspot/share/services/attachListener.cpp
Print this page
*** 43,53 ****
#include "services/heapDumper.hpp"
#include "services/writeableFlags.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
! volatile bool AttachListener::_initialized;
// Implementation of "properties" command.
//
// Invokes VMSupport.serializePropertiesToByteArray to serialize
// the system properties into a byte array.
--- 43,53 ----
#include "services/heapDumper.hpp"
#include "services/writeableFlags.hpp"
#include "utilities/debug.hpp"
#include "utilities/formatBuffer.hpp"
! volatile AttachListenerState AttachListener::_state = AL_NOT_INITIALIZED;
// Implementation of "properties" command.
//
// Invokes VMSupport.serializePropertiesToByteArray to serialize
// the system properties into a byte array.
*** 370,386 ****
--- 370,388 ----
assert(thread == Thread::current(), "Must be");
assert(thread->stack_base() != NULL && thread->stack_size() > 0,
"Should already be setup");
if (AttachListener::pd_init() != 0) {
+ AttachListener::set_state(AL_NOT_INITIALIZED);
return;
}
AttachListener::set_initialized();
for (;;) {
AttachOperation* op = AttachListener::dequeue();
if (op == NULL) {
+ AttachListener::set_state(AL_NOT_INITIALIZED);
return; // dequeue failed or shutdown
}
ResourceMark rm;
bufferedStream st;
*** 420,429 ****
--- 422,433 ----
}
// operation complete - send result and output to client
op->complete(res, &st);
}
+
+ AttachListener::set_state(AL_NOT_INITIALIZED);
}
bool AttachListener::has_init_error(TRAPS) {
if (HAS_PENDING_EXCEPTION) {
tty->print_cr("Exception in VM (AttachListener::init) : ");
*** 443,452 ****
--- 447,457 ----
EXCEPTION_MARK;
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;
}
// Initialize thread_oop to put it into the system threadGroup
Handle thread_group (THREAD, Universe::system_thread_group());
*** 454,463 ****
--- 459,469 ----
vmSymbols::threadgroup_string_void_signature(),
thread_group,
string,
THREAD);
if (has_init_error(THREAD)) {
+ set_state(AL_NOT_INITIALIZED);
return;
}
Klass* group = SystemDictionary::ThreadGroup_klass();
JavaValue result(T_VOID);
*** 467,476 ****
--- 473,483 ----
vmSymbols::add_method_name(),
vmSymbols::thread_void_signature(),
thread_oop,
THREAD);
if (has_init_error(THREAD)) {
+ set_state(AL_NOT_INITIALIZED);
return;
}
{ MutexLocker mu(Threads_lock);
JavaThread* listener_thread = new JavaThread(&attach_listener_thread_entry);
< prev index next >