268 if (UsePerfData) { 269 // jvmstat performance counters 270 Thread* THREAD = Thread::current(); 271 _perf_accumulated_vm_operation_time = 272 PerfDataManager::create_counter(SUN_THREADS, "vmOperationTime", 273 PerfData::U_Ticks, CHECK); 274 } 275 } 276 277 VMThread::VMThread() : NamedThread() { 278 set_name("VM Thread"); 279 } 280 281 void VMThread::destroy() { 282 _vm_thread = NULL; // VM thread is gone 283 } 284 285 void VMThread::run() { 286 assert(this == vm_thread(), "check"); 287 288 this->initialize_named_thread(); 289 290 // Notify_lock wait checks on active_handles() to rewait in 291 // case of spurious wakeup, it should wait on the last 292 // value set prior to the notify 293 this->set_active_handles(JNIHandleBlock::allocate_block()); 294 295 { 296 MutexLocker ml(Notify_lock); 297 Notify_lock->notify(); 298 } 299 // Notify_lock is destroyed by Threads::create_vm() 300 301 int prio = (VMThreadPriority == -1) 302 ? os::java_to_os_priority[NearMaxPriority] 303 : VMThreadPriority; 304 // Note that I cannot call os::set_priority because it expects Java 305 // priorities and I am *explicitly* using OS priorities so that it's 306 // possible to set the VM thread priority higher than any Java thread. 307 os::set_native_priority( this, prio ); 308 309 // Wait for VM_Operations until termination | 268 if (UsePerfData) { 269 // jvmstat performance counters 270 Thread* THREAD = Thread::current(); 271 _perf_accumulated_vm_operation_time = 272 PerfDataManager::create_counter(SUN_THREADS, "vmOperationTime", 273 PerfData::U_Ticks, CHECK); 274 } 275 } 276 277 VMThread::VMThread() : NamedThread() { 278 set_name("VM Thread"); 279 } 280 281 void VMThread::destroy() { 282 _vm_thread = NULL; // VM thread is gone 283 } 284 285 void VMThread::run() { 286 assert(this == vm_thread(), "check"); 287 288 // Notify_lock wait checks on active_handles() to rewait in 289 // case of spurious wakeup, it should wait on the last 290 // value set prior to the notify 291 this->set_active_handles(JNIHandleBlock::allocate_block()); 292 293 { 294 MutexLocker ml(Notify_lock); 295 Notify_lock->notify(); 296 } 297 // Notify_lock is destroyed by Threads::create_vm() 298 299 int prio = (VMThreadPriority == -1) 300 ? os::java_to_os_priority[NearMaxPriority] 301 : VMThreadPriority; 302 // Note that I cannot call os::set_priority because it expects Java 303 // priorities and I am *explicitly* using OS priorities so that it's 304 // possible to set the VM thread priority higher than any Java thread. 305 os::set_native_priority( this, prio ); 306 307 // Wait for VM_Operations until termination |