mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 18:03:44 +00:00
8358621: Reduce busy waiting in worse case at the synchronization point returning from native in CPU Time Profiler
Reviewed-by: shade Backport-of: d2082c58ff086eb37c6211a8d1b813cdfedc2259
This commit is contained in:
parent
07bb0e3e2f
commit
533211af73
@ -45,6 +45,7 @@
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/threadIdentifier.hpp"
|
||||
#include "utilities/sizes.hpp"
|
||||
#include "utilities/spinYield.hpp"
|
||||
|
||||
JfrThreadLocal::JfrThreadLocal() :
|
||||
_sample_request(),
|
||||
@ -600,7 +601,10 @@ bool JfrThreadLocal::try_acquire_cpu_time_jfr_dequeue_lock() {
|
||||
}
|
||||
|
||||
void JfrThreadLocal::acquire_cpu_time_jfr_dequeue_lock() {
|
||||
while (Atomic::cmpxchg(&_cpu_time_jfr_locked, UNLOCKED, DEQUEUE) != UNLOCKED);
|
||||
SpinYield s;
|
||||
while (Atomic::cmpxchg(&_cpu_time_jfr_locked, UNLOCKED, DEQUEUE) != UNLOCKED) {
|
||||
s.wait();
|
||||
}
|
||||
}
|
||||
|
||||
void JfrThreadLocal::release_cpu_time_jfr_queue_lock() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user