< prev index next >

src/hotspot/share/runtime/vmThread.cpp

Print this page




 225   if (UsePerfData) {
 226     // jvmstat performance counters
 227     Thread* THREAD = Thread::current();
 228     _perf_accumulated_vm_operation_time =
 229                  PerfDataManager::create_counter(SUN_THREADS, "vmOperationTime",
 230                                                  PerfData::U_Ticks, CHECK);
 231   }
 232 }
 233 
 234 VMThread::VMThread() : NamedThread() {
 235   set_name("VM Thread");
 236 }
 237 
 238 void VMThread::destroy() {
 239   _vm_thread = NULL;      // VM thread is gone
 240 }
 241 
 242 void VMThread::run() {
 243   assert(this == vm_thread(), "check");
 244 
 245   this->initialize_named_thread();
 246 
 247   // Notify_lock wait checks on active_handles() to rewait in
 248   // case of spurious wakeup, it should wait on the last
 249   // value set prior to the notify
 250   this->set_active_handles(JNIHandleBlock::allocate_block());
 251 
 252   {
 253     MutexLocker ml(Notify_lock);
 254     Notify_lock->notify();
 255   }
 256   // Notify_lock is destroyed by Threads::create_vm()
 257 
 258   int prio = (VMThreadPriority == -1)
 259     ? os::java_to_os_priority[NearMaxPriority]
 260     : VMThreadPriority;
 261   // Note that I cannot call os::set_priority because it expects Java
 262   // priorities and I am *explicitly* using OS priorities so that it's
 263   // possible to set the VM thread priority higher than any Java thread.
 264   os::set_native_priority( this, prio );
 265 
 266   // Wait for VM_Operations until termination




 225   if (UsePerfData) {
 226     // jvmstat performance counters
 227     Thread* THREAD = Thread::current();
 228     _perf_accumulated_vm_operation_time =
 229                  PerfDataManager::create_counter(SUN_THREADS, "vmOperationTime",
 230                                                  PerfData::U_Ticks, CHECK);
 231   }
 232 }
 233 
 234 VMThread::VMThread() : NamedThread() {
 235   set_name("VM Thread");
 236 }
 237 
 238 void VMThread::destroy() {
 239   _vm_thread = NULL;      // VM thread is gone
 240 }
 241 
 242 void VMThread::run() {
 243   assert(this == vm_thread(), "check");
 244 


 245   // Notify_lock wait checks on active_handles() to rewait in
 246   // case of spurious wakeup, it should wait on the last
 247   // value set prior to the notify
 248   this->set_active_handles(JNIHandleBlock::allocate_block());
 249 
 250   {
 251     MutexLocker ml(Notify_lock);
 252     Notify_lock->notify();
 253   }
 254   // Notify_lock is destroyed by Threads::create_vm()
 255 
 256   int prio = (VMThreadPriority == -1)
 257     ? os::java_to_os_priority[NearMaxPriority]
 258     : VMThreadPriority;
 259   // Note that I cannot call os::set_priority because it expects Java
 260   // priorities and I am *explicitly* using OS priorities so that it's
 261   // possible to set the VM thread priority higher than any Java thread.
 262   os::set_native_priority( this, prio );
 263 
 264   // Wait for VM_Operations until termination


< prev index next >