src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
branchJEP-349-branch
changeset 58154 060d9d139109
parent 57878 bffba8d6611a
parent 57699 4aea554692aa
equal deleted inserted replaced
58101:84b0544833c4 58154:060d9d139109
   520 
   520 
   521   {
   521   {
   522     elapsedTimer sample_time;
   522     elapsedTimer sample_time;
   523     sample_time.start();
   523     sample_time.start();
   524     {
   524     {
   525       MutexLocker tlock(Threads_lock, Mutex::_no_safepoint_check_flag);
   525       MutexLocker tlock(Threads_lock);
   526       ThreadsListHandle tlh;
   526       ThreadsListHandle tlh;
   527       // Resolve a sample session relative start position index into the thread list array.
   527       // Resolve a sample session relative start position index into the thread list array.
   528       // In cases where the last sampled thread is NULL or not-NULL but stale, find_index() returns -1.
   528       // In cases where the last sampled thread is NULL or not-NULL but stale, find_index() returns -1.
   529       _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
   529       _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
   530       JavaThread* current = _cur_index != -1 ? *last_thread : NULL;
   530       JavaThread* current = _cur_index != -1 ? *last_thread : NULL;