< prev index next >

src/hotspot/share/runtime/vmThread.cpp

Print this page




 186     queue_oops_do(i, f);
 187   }
 188   drain_list_oops_do(f);
 189 }
 190 
 191 //------------------------------------------------------------------------------------------------------------------
 192 // Timeout machinery
 193 
 194 void VMOperationTimeoutTask::task() {
 195   assert(AbortVMOnVMOperationTimeout, "only if enabled");
 196   if (is_armed()) {
 197     jlong delay = (os::javaTimeMillis() - _arm_time);
 198     if (delay > AbortVMOnVMOperationTimeoutDelay) {
 199       fatal("VM operation took too long: " JLONG_FORMAT " ms (timeout: " INTX_FORMAT " ms)",
 200             delay, AbortVMOnVMOperationTimeoutDelay);
 201     }
 202   }
 203 }
 204 
 205 bool VMOperationTimeoutTask::is_armed() {
 206   return OrderAccess::load_acquire(&_armed) != 0;
 207 }
 208 
 209 void VMOperationTimeoutTask::arm() {
 210   _arm_time = os::javaTimeMillis();
 211   OrderAccess::release_store_fence(&_armed, 1);
 212 }
 213 
 214 void VMOperationTimeoutTask::disarm() {
 215   OrderAccess::release_store_fence(&_armed, 0);
 216 }
 217 
 218 //------------------------------------------------------------------------------------------------------------------
 219 // Implementation of VMThread stuff
 220 
 221 bool              VMThread::_should_terminate   = false;
 222 bool              VMThread::_terminated         = false;
 223 Monitor*          VMThread::_terminate_lock     = NULL;
 224 VMThread*         VMThread::_vm_thread          = NULL;
 225 VM_Operation*     VMThread::_cur_vm_operation   = NULL;
 226 VMOperationQueue* VMThread::_vm_queue           = NULL;
 227 PerfCounter*      VMThread::_perf_accumulated_vm_operation_time = NULL;
 228 uint64_t          VMThread::_coalesced_count = 0;
 229 VMOperationTimeoutTask* VMThread::_timeout_task = NULL;
 230 
 231 
 232 void VMThread::create() {
 233   assert(vm_thread() == NULL, "we can only allocate one VMThread");
 234   _vm_thread = new VMThread();
 235 




 186     queue_oops_do(i, f);
 187   }
 188   drain_list_oops_do(f);
 189 }
 190 
 191 //------------------------------------------------------------------------------------------------------------------
 192 // Timeout machinery
 193 
 194 void VMOperationTimeoutTask::task() {
 195   assert(AbortVMOnVMOperationTimeout, "only if enabled");
 196   if (is_armed()) {
 197     jlong delay = (os::javaTimeMillis() - _arm_time);
 198     if (delay > AbortVMOnVMOperationTimeoutDelay) {
 199       fatal("VM operation took too long: " JLONG_FORMAT " ms (timeout: " INTX_FORMAT " ms)",
 200             delay, AbortVMOnVMOperationTimeoutDelay);
 201     }
 202   }
 203 }
 204 
 205 bool VMOperationTimeoutTask::is_armed() {
 206   return Atomic::load_acquire(&_armed) != 0;
 207 }
 208 
 209 void VMOperationTimeoutTask::arm() {
 210   _arm_time = os::javaTimeMillis();
 211   Atomic::release_store_fence(&_armed, 1);
 212 }
 213 
 214 void VMOperationTimeoutTask::disarm() {
 215   Atomic::release_store_fence(&_armed, 0);
 216 }
 217 
 218 //------------------------------------------------------------------------------------------------------------------
 219 // Implementation of VMThread stuff
 220 
 221 bool              VMThread::_should_terminate   = false;
 222 bool              VMThread::_terminated         = false;
 223 Monitor*          VMThread::_terminate_lock     = NULL;
 224 VMThread*         VMThread::_vm_thread          = NULL;
 225 VM_Operation*     VMThread::_cur_vm_operation   = NULL;
 226 VMOperationQueue* VMThread::_vm_queue           = NULL;
 227 PerfCounter*      VMThread::_perf_accumulated_vm_operation_time = NULL;
 228 uint64_t          VMThread::_coalesced_count = 0;
 229 VMOperationTimeoutTask* VMThread::_timeout_task = NULL;
 230 
 231 
 232 void VMThread::create() {
 233   assert(vm_thread() == NULL, "we can only allocate one VMThread");
 234   _vm_thread = new VMThread();
 235 


< prev index next >