- 
    Enhancement 
- 
    Resolution: Unresolved
- 
     P4 P4
- 
    22
We'd like to switch to update total_gc_cpu_time counter in the ~ThreadTotalCPUTimeClosure() destructor, i.e., every time an individual sun.threads.cpu_time.gc_* counter is updated. This will also simplify the code as we can get rid of the `CPUTimeCounters::inc_gc_total_cpu_time()` and `CPUTimeCounters::publish_gc_total_cpu_time()` functions.
There are two ideas to solve this:
1. Introduce a lock to guard the updates to sun.threads.total_gc_cpu_time counter.
2. Introduce a `PerfAtomicCounter` class, which is a PerfCounter than supports `Atomic::add()`.
- relates to
- 
                    JDK-8315149 Add hsperf counters for CPU time of internal GC threads -           
- Resolved
 
-