< prev index next >

src/hotspot/share/services/attachListener.cpp

Print this page




 317   { "dumpheap",         dump_heap },
 318   { "load",             load_agent },
 319   { "properties",       get_system_properties },
 320   { "threaddump",       thread_dump },
 321   { "inspectheap",      heap_inspection },
 322   { "setflag",          set_flag },
 323   { "printflag",        print_flag },
 324   { "jcmd",             jcmd },
 325   { NULL,               NULL }
 326 };
 327 
 328 
 329 
 330 // The Attach Listener threads services a queue. It dequeues an operation
 331 // from the queue, examines the operation name (command), and dispatches
 332 // to the corresponding function to perform the operation.
 333 
 334 static void attach_listener_thread_entry(JavaThread* thread, TRAPS) {
 335   os::set_priority(thread, NearMaxPriority);
 336 
 337   thread->record_stack_base_and_size();


 338 
 339   if (AttachListener::pd_init() != 0) {
 340     return;
 341   }
 342   AttachListener::set_initialized();
 343 
 344   for (;;) {
 345     AttachOperation* op = AttachListener::dequeue();
 346     if (op == NULL) {
 347       return;   // dequeue failed or shutdown
 348     }
 349 
 350     ResourceMark rm;
 351     bufferedStream st;
 352     jint res = JNI_OK;
 353 
 354     // handle special detachall operation
 355     if (strcmp(op->name(), AttachOperation::detachall_operation_name()) == 0) {
 356       AttachListener::detachall();
 357     } else if (!EnableDynamicAgentLoading && strcmp(op->name(), "load") == 0) {




 317   { "dumpheap",         dump_heap },
 318   { "load",             load_agent },
 319   { "properties",       get_system_properties },
 320   { "threaddump",       thread_dump },
 321   { "inspectheap",      heap_inspection },
 322   { "setflag",          set_flag },
 323   { "printflag",        print_flag },
 324   { "jcmd",             jcmd },
 325   { NULL,               NULL }
 326 };
 327 
 328 
 329 
 330 // The Attach Listener threads services a queue. It dequeues an operation
 331 // from the queue, examines the operation name (command), and dispatches
 332 // to the corresponding function to perform the operation.
 333 
 334 static void attach_listener_thread_entry(JavaThread* thread, TRAPS) {
 335   os::set_priority(thread, NearMaxPriority);
 336 
 337   assert(thread == Thread::current(), "Must be");
 338   assert(thread->stack_base() != NULL && thread->stack_size() > 0,
 339          "Should already setup");
 340 
 341   if (AttachListener::pd_init() != 0) {
 342     return;
 343   }
 344   AttachListener::set_initialized();
 345 
 346   for (;;) {
 347     AttachOperation* op = AttachListener::dequeue();
 348     if (op == NULL) {
 349       return;   // dequeue failed or shutdown
 350     }
 351 
 352     ResourceMark rm;
 353     bufferedStream st;
 354     jint res = JNI_OK;
 355 
 356     // handle special detachall operation
 357     if (strcmp(op->name(), AttachOperation::detachall_operation_name()) == 0) {
 358       AttachListener::detachall();
 359     } else if (!EnableDynamicAgentLoading && strcmp(op->name(), "load") == 0) {


< prev index next >