mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8165675: Trace event for thread park has incorrect unit for timeout
Reviewed-by: mgronlun
This commit is contained in:
parent
b7bd4bccbf
commit
85ffc2803c
8 changed files with 158 additions and 20 deletions
|
@ -926,11 +926,12 @@ UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetLong(JNIEnv *env, jobject unsafe, job
|
|||
}
|
||||
} UNSAFE_END
|
||||
|
||||
static void post_thread_park_event(EventThreadPark* event, const oop obj, jlong timeout) {
|
||||
static void post_thread_park_event(EventThreadPark* event, const oop obj, jlong timeout_nanos, jlong until_epoch_millis) {
|
||||
assert(event != NULL, "invariant");
|
||||
assert(event->should_commit(), "invariant");
|
||||
event->set_parkedClass((obj != NULL) ? obj->klass() : NULL);
|
||||
event->set_timeout(timeout);
|
||||
event->set_timeout(timeout_nanos);
|
||||
event->set_until(until_epoch_millis);
|
||||
event->set_address((obj != NULL) ? (u8)cast_from_oop<uintptr_t>(obj) : 0);
|
||||
event->commit();
|
||||
}
|
||||
|
@ -942,7 +943,16 @@ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute,
|
|||
JavaThreadParkedState jtps(thread, time != 0);
|
||||
thread->parker()->park(isAbsolute != 0, time);
|
||||
if (event.should_commit()) {
|
||||
post_thread_park_event(&event, thread->current_park_blocker(), time);
|
||||
const oop obj = thread->current_park_blocker();
|
||||
if (time == 0) {
|
||||
post_thread_park_event(&event, obj, min_jlong, min_jlong);
|
||||
} else {
|
||||
if (isAbsolute != 0) {
|
||||
post_thread_park_event(&event, obj, min_jlong, time);
|
||||
} else {
|
||||
post_thread_park_event(&event, obj, time, min_jlong);
|
||||
}
|
||||
}
|
||||
}
|
||||
HOTSPOT_THREAD_PARK_END((uintptr_t) thread->parker());
|
||||
} UNSAFE_END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue