src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54645 05aaccf7d558
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   460       _sample.wait();
   460       _sample.wait();
   461       last_java_ms = get_monotonic_ms();
   461       last_java_ms = get_monotonic_ms();
   462       last_native_ms = last_java_ms;
   462       last_native_ms = last_java_ms;
   463     }
   463     }
   464     _sample.signal();
   464     _sample.signal();
   465     jlong java_interval = _interval_java == 0 ? max_jlong : MAX2<jlong>(_interval_java, 10);
   465     jlong java_interval = _interval_java == 0 ? max_jlong : MAX2<jlong>(_interval_java, 1);
   466     jlong native_interval = _interval_native == 0 ? max_jlong : MAX2<jlong>(_interval_native, 10);
   466     jlong native_interval = _interval_native == 0 ? max_jlong : MAX2<jlong>(_interval_native, 1);
   467 
   467 
   468     jlong now_ms = get_monotonic_ms();
   468     jlong now_ms = get_monotonic_ms();
   469 
   469 
   470     /*
   470     /*
   471      * Let I be java_interval or native_interval.
   471      * Let I be java_interval or native_interval.
   514 
   514 
   515   {
   515   {
   516     elapsedTimer sample_time;
   516     elapsedTimer sample_time;
   517     sample_time.start();
   517     sample_time.start();
   518     {
   518     {
   519       MutexLocker tlock(Threads_lock, Mutex::_no_safepoint_check_flag);
   519       MutexLocker tlock(Threads_lock);
   520       ThreadsListHandle tlh;
   520       ThreadsListHandle tlh;
   521       // Resolve a sample session relative start position index into the thread list array.
   521       // Resolve a sample session relative start position index into the thread list array.
   522       // In cases where the last sampled thread is NULL or not-NULL but stale, find_index() returns -1.
   522       // In cases where the last sampled thread is NULL or not-NULL but stale, find_index() returns -1.
   523       _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
   523       _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
   524       JavaThread* current = _cur_index != -1 ? *last_thread : NULL;
   524       JavaThread* current = _cur_index != -1 ? *last_thread : NULL;