On Mon, 8 May 2023 16:41:13 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:

>> src/hotspot/share/services/threadService.cpp line 173:
>> 
>>> 171:     // was not called, e.g., 
>>> JavaThread::cleanup_failed_attach_current_thread().
>>> 172:     decrement_thread_counts(thread, daemon);
>>> 173:     
>>> ThreadService::incr_exited_allocated_bytes(thread->cooked_allocated_bytes());
>> 
>> By doing this here you increase the likelihood of double-accounting for this 
>> thread. If you do this after the thread is no longer on any threads-list you 
>> may miss its contribution entirely, but you won't double-count it.
>
> If the `thread` is no longer on any ThreadsList, then it is not safe to 
> access `thread`.

@dcubed-ojdk This is the current thread acting on itself

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1188019689

Reply via email to