src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/runtime/thread.cpp

src/share/vm/runtime/thread.cpp

Print this page
rev 5732 : [mq]: comments2

*** 765,775 **** #ifndef PRODUCT void JavaThread::record_jump(address target, address instr, const char* file, int line) { // This should not need to be atomic as the only way for simultaneous ! // updates is via interrupts. Even then this should be rare or non-existant // and we don't care that much anyway. int index = _jmp_ring_index; _jmp_ring_index = (index + 1 ) & (jump_ring_buffer_size - 1); _jmp_ring[index]._target = (intptr_t) target; --- 765,775 ---- #ifndef PRODUCT void JavaThread::record_jump(address target, address instr, const char* file, int line) { // This should not need to be atomic as the only way for simultaneous ! // updates is via interrupts. Even then this should be rare or non-existent // and we don't care that much anyway. int index = _jmp_ring_index; _jmp_ring_index = (index + 1 ) & (jump_ring_buffer_size - 1); _jmp_ring[index]._target = (intptr_t) target;
*** 923,936 **** // This could potentially lead to deadlocks for(Monitor *cur = _owned_locks; cur; cur = cur->next()) { // Threads_lock is special, since the safepoint synchronization will not start before this is // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock, // since it is used to transfer control between JavaThreads and the VMThread ! // Do not *exclude* any locks unless you are absolutly sure it is correct. Ask someone else first! if ( (cur->allow_vm_block() && cur != Threads_lock && ! cur != Compile_lock && // Temporary: should not be necessary when we get spearate compilation cur != VMOperationRequest_lock && cur != VMOperationQueue_lock) || cur->rank() == Mutex::special) { warning("Thread holding lock at safepoint that vm can block on: %s", cur->name()); } --- 923,936 ---- // This could potentially lead to deadlocks for(Monitor *cur = _owned_locks; cur; cur = cur->next()) { // Threads_lock is special, since the safepoint synchronization will not start before this is // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock, // since it is used to transfer control between JavaThreads and the VMThread ! // Do not *exclude* any locks unless you are absolutely sure it is correct. Ask someone else first! if ( (cur->allow_vm_block() && cur != Threads_lock && ! cur != Compile_lock && // Temporary: should not be necessary when we get separate compilation cur != VMOperationRequest_lock && cur != VMOperationQueue_lock) || cur->rank() == Mutex::special) { warning("Thread holding lock at safepoint that vm can block on: %s", cur->name()); }
*** 1269,1279 **** // if we didn't have any tasks we could have waited for a long time // consider the time_slept zero and reset time_before_loop time_slept = 0; time_before_loop = now; } else { ! // need to recalulate since we might have new tasks in _tasks time_slept = (int) ((now - time_before_loop) / 1000000); } // Change to task list or spurious wakeup of some kind if (timedout || _should_terminate) { --- 1269,1279 ---- // if we didn't have any tasks we could have waited for a long time // consider the time_slept zero and reset time_before_loop time_slept = 0; time_before_loop = now; } else { ! // need to recalculate since we might have new tasks in _tasks time_slept = (int) ((now - time_before_loop) / 1000000); } // Change to task list or spurious wakeup of some kind if (timedout || _should_terminate) {
*** 1636,1646 **** // The first routine called by a new Java thread void JavaThread::run() { // initialize thread-local alloc buffer related fields this->initialize_tlab(); ! // used to test validitity of stack trace backs this->record_base_of_stack_pointer(); // Record real stack base and size. this->record_stack_base_and_size(); --- 1636,1646 ---- // The first routine called by a new Java thread void JavaThread::run() { // initialize thread-local alloc buffer related fields this->initialize_tlab(); ! // used to test validity of stack trace backs this->record_base_of_stack_pointer(); // Record real stack base and size. this->record_stack_base_and_size();
*** 3318,3328 **** os::init(); // Initialize system properties. Arguments::init_system_properties(); ! // So that JDK version can be used as a discrimintor when parsing arguments JDK_Version_init(); // Update/Initialize System properties after JDK version number is known Arguments::init_version_specific_system_properties(); --- 3318,3328 ---- os::init(); // Initialize system properties. Arguments::init_system_properties(); ! // So that JDK version can be used as a discriminator when parsing arguments JDK_Version_init(); // Update/Initialize System properties after JDK version number is known Arguments::init_version_specific_system_properties();
*** 3357,3367 **** if (os_init_2_result != JNI_OK) return os_init_2_result; jint adjust_after_os_result = Arguments::adjust_after_os(); if (adjust_after_os_result != JNI_OK) return adjust_after_os_result; ! // intialize TLS ThreadLocalStorage::init(); // Bootstrap native memory tracking, so it can start recording memory // activities before worker thread is started. This is the first phase // of bootstrapping, VM is currently running in single-thread mode. --- 3357,3367 ---- if (os_init_2_result != JNI_OK) return os_init_2_result; jint adjust_after_os_result = Arguments::adjust_after_os(); if (adjust_after_os_result != JNI_OK) return adjust_after_os_result; ! // initialize TLS ThreadLocalStorage::init(); // Bootstrap native memory tracking, so it can start recording memory // activities before worker thread is started. This is the first phase // of bootstrapping, VM is currently running in single-thread mode.
*** 4154,4164 **** // Operations on the Threads list for GC. These are not explicitly locked, // but the garbage collector must provide a safe context for them to run. // In particular, these things should never be called when the Threads_lock // is held by some other thread. (Note: the Safepoint abstraction also ! // uses the Threads_lock to gurantee this property. It also makes sure that // all threads gets blocked when exiting or starting). void Threads::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { ALL_JAVA_THREADS(p) { p->oops_do(f, cld_f, cf); --- 4154,4164 ---- // Operations on the Threads list for GC. These are not explicitly locked, // but the garbage collector must provide a safe context for them to run. // In particular, these things should never be called when the Threads_lock // is held by some other thread. (Note: the Safepoint abstraction also ! // uses the Threads_lock to guarantee this property. It also makes sure that // all threads gets blocked when exiting or starting). void Threads::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { ALL_JAVA_THREADS(p) { p->oops_do(f, cld_f, cf);
src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File