Skip to content

Commit

Permalink
Merge pull request #15499 from JasonFengJ9/threadpws
Browse files Browse the repository at this point in the history
CRIU adjusts Object.wait/Thread.sleep/Unsafe.park
  • Loading branch information
tajila committed Oct 19, 2022
2 parents 0d7572f + 99d5aff commit 88207cc
Show file tree
Hide file tree
Showing 15 changed files with 702 additions and 268 deletions.
9 changes: 5 additions & 4 deletions runtime/criusupport/criusupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl(JNIEnv *env,
J9VMThread *currentThread = (J9VMThread*)env;
J9JavaVM *vm = currentThread->javaVM;
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
J9PortLibrary *portLibrary = vm->portLibrary;

jclass currentExceptionClass = NULL;
char *exceptionMsg = NULL;
Expand Down Expand Up @@ -510,7 +511,7 @@ Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl(JNIEnv *env,
}

vm->checkpointState.checkpointRestoreTimeDelta = 0;
vm->portLibrary->nanoTimeMonotonicClockDelta = 0;
portLibrary->nanoTimeMonotonicClockDelta = 0;
checkpointNanoTimeMonotonic = j9time_nano_time();
checkpointNanoUTCTime = j9time_current_time_nanos(&success);
if (0 == success) {
Expand Down Expand Up @@ -569,8 +570,6 @@ Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl(JNIEnv *env,
* which is expected to be accurate in scenarios such as host rebooting, CRIU image moving across timezones.
*/
vm->checkpointState.checkpointRestoreTimeDelta = (I_64)(restoreNanoUTCTime - checkpointNanoUTCTime);
Trc_CRIU_after_checkpoint(currentThread, restoreNanoUTCTime, checkpointNanoUTCTime, vm->checkpointState.checkpointRestoreTimeDelta,
restoreNanoTimeMonotonic, checkpointNanoTimeMonotonic, vm->checkpointState.checkpointRestoreTimeDelta);
if (vm->checkpointState.checkpointRestoreTimeDelta < 0) {
/* A negative value was calculated for checkpointRestoreTimeDelta,
* Trc_CRIU_before_checkpoint & Trc_CRIU_after_checkpoint can be used for further investigation.
Expand All @@ -588,7 +587,9 @@ Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl(JNIEnv *env,
* if there is no change for j9time_nano_time() start point.
* This value might be negative.
*/
vm->portLibrary->nanoTimeMonotonicClockDelta = restoreNanoTimeMonotonic - checkpointNanoTimeMonotonic;
portLibrary->nanoTimeMonotonicClockDelta = restoreNanoTimeMonotonic - checkpointNanoTimeMonotonic;
Trc_CRIU_after_checkpoint(currentThread, restoreNanoUTCTime, checkpointNanoUTCTime, vm->checkpointState.checkpointRestoreTimeDelta,
restoreNanoTimeMonotonic, checkpointNanoTimeMonotonic, portLibrary->nanoTimeMonotonicClockDelta);

/* We can only end up here if the CRIU restore was successful */
isAfterCheckpoint = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion runtime/criusupport/j9criu.tdf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TraceException=Trc_CRIU_getNativeString_getStringSizeFail Overhead=1 Level=1 Tem
TraceException=Trc_CRIU_getNativeString_convertFail Overhead=1 Level=1 Template="Failed to convert Java string: mutf8String=%s mutf8StringSize=%zu requiredConvertedStringSize=%zd"

TraceEvent=Trc_CRIU_before_checkpoint Overhead=1 Level=2 Template="Before checkpoint criu_dump(), checkpointNanoTimeMonotonic = %lld, checkpointNanoUTCTime = %llu"
TraceEvent=Trc_CRIU_after_checkpoint Overhead=1 Level=2 Template="After checkpoint criu_dump(), restoreNanoUTCTime = %llu, checkpointNanoUTCTime = %llu, restoreNanoTimeMonotonic = %lld, checkpointNanoTimeMonotonic = %lld, checkpointNanoTimeMonotonic = %lld, checkpointRestoreTimeDelta = %lld"
TraceEvent=Trc_CRIU_after_checkpoint Overhead=1 Level=2 Template="After checkpoint criu_dump(), restoreNanoUTCTime = %llu, checkpointNanoUTCTime = %llu, checkpointRestoreTimeDelta = %lld, restoreNanoTimeMonotonic = %lld, checkpointNanoTimeMonotonic = %lld, nanoTimeMonotonicClockDelta = %lld"
TraceEntry=Trc_CRIU_checkpointJVMImpl_Entry Overhead=1 Level=2 Template="Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl"
TraceExit=Trc_CRIU_checkpointJVMImpl_Exit Overhead=1 Level=2 Template="Java_org_eclipse_openj9_criu_CRIUSupport_checkpointJVMImpl"
TraceEvent=Trc_CRIU_checkpointJVMImpl_checkIfSafeToCheckpointBlocked Overhead=1 Level=2 Template="Checkpoint blocked because thread=%p is in method=%p marked as not safe to checkpoint"
Expand Down
2 changes: 1 addition & 1 deletion runtime/jcl/common/sun_misc_Unsafe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Java_sun_misc_Unsafe_park(JNIEnv *env, jobject receiver, jboolean isAbsolute, jl
J9JavaVM *vm = currentThread->javaVM;
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
vmFuncs->internalEnterVMFromJNI(currentThread);
vmFuncs->threadParkImpl(currentThread, (IDATA)isAbsolute, (I_64)time);
vmFuncs->threadParkImpl(currentThread, isAbsolute ? TRUE : FALSE, (I_64)time);
vmFuncs->internalExitVMToJNI(currentThread);
}

Expand Down
28 changes: 14 additions & 14 deletions runtime/nls/j9cl/j9jcl.nls
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_UNSUPPORTED_MSG.user_response=Remove the -XX:-

J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_ERROR=Error retrieving JVM CPU usage information.
# START NON-TRANSLATABLE
J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_ERROR.explanation=Internal error occured when retrieving JVM CPU usage information.
J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_ERROR.explanation=Internal error occurred when retrieving JVM CPU usage information.
J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_ERROR.system_action=The JVM will continue, but no JVM CPU usage related information will be provided.
J9NLS_JCL_JVM_CPU_USAGE_RETRIEVAL_ERROR.user_response=Contact your service representative.
# END NON-TRANSLATABLE
Expand Down Expand Up @@ -447,95 +447,95 @@ J9NLS_JCL_DUPLICATE_CLASS_DEFINITION.user_response=Ensure there is no duplicate
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR=Could not open the checkpoint data directory, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR.explanation=An error occured when the JVM attempted to open the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR.explanation=An error occurred when the JVM attempted to open the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR.system_action=The JVM will throw a JVMCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_DIR.user_response=Ensure the specified directory is accessible.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_INIT_FAILED=Could not init CRIU options, err=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_INIT_FAILED.sample_input_1=1
J9NLS_JCL_CRIU_INIT_FAILED.explanation=An error occured when the JVM attempted to initialize CRIU options.
J9NLS_JCL_CRIU_INIT_FAILED.explanation=An error occurred when the JVM attempted to initialize CRIU options.
J9NLS_JCL_CRIU_INIT_FAILED.system_action=The JVM will throw a SystemCheckpointException.
J9NLS_JCL_CRIU_INIT_FAILED.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_DUMP_FAILED=Could not dump the JVM processs, err=%li
J9NLS_JCL_CRIU_DUMP_FAILED=Could not dump the JVM processes, err=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_DUMP_FAILED.sample_input_1=1
J9NLS_JCL_CRIU_DUMP_FAILED.explanation=An error occured when the JVM attempted to dump the process via criu_dump.
J9NLS_JCL_CRIU_DUMP_FAILED.explanation=An error occurred when the JVM attempted to dump the process via criu_dump.
J9NLS_JCL_CRIU_DUMP_FAILED.system_action=The JVM will throw a SystemCheckpointException.
J9NLS_JCL_CRIU_DUMP_FAILED.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR=Could not close the checkpoint data directory, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR.explanation=An error occured when the JVM attempted to close the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR.explanation=An error occurred when the JVM attempted to close the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR.system_action=The JVM will throw a RestoreException or SystemCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_DIR.user_response=Ensure the specified directory is accessible.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING=Could not convert java string to native encoding, err=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING.explanation=An error occured when the JVM attempted to convert a java string to native encoding.
J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING.explanation=An error occurred when the JVM attempted to convert a java string to native encoding.
J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING.system_action=The JVM will throw a JVMCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_CONVERT_JAVA_STRING.user_response=Ensure the specified input strings are valid.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR=Could not open the work directory, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR.explanation=An error occured when the JVM attempted to open the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR.explanation=An error occurred when the JVM attempted to open the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR.system_action=The JVM will throw a JVMCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_OPEN_WORK_DIR.user_response=Ensure the specified directory is accessible.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR=Could not close the work directory, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR.explanation=An error occured when the JVM attempted to close the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR.explanation=An error occurred when the JVM attempted to close the specified directory.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR.system_action=The JVM will throw a RestoreException or SystemCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_CLOSE_WORK_DIR.user_response=Ensure the specified directory is accessible.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS=Could not run internal checkpoint hooks, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS.explanation=An error occured when the JVM attempted to run internal checkpoint hooks.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS.explanation=An error occurred when the JVM attempted to run internal checkpoint hooks.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS.system_action=The JVM will throw a SystemCheckpointException.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_CHECKPOINT_HOOKS.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS=Could not run internal restore hooks, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS.explanation=An error occured when the JVM attempted to run internal restore hooks.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS.explanation=An error occurred when the JVM attempted to run internal restore hooks.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS.system_action=The JVM will throw a RestoreException.
J9NLS_JCL_CRIU_FAILED_TO_RUN_INTERNAL_RESTORE_HOOKS.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS=Could not run delayed lock-related operations successfully, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS.sample_input_1=1
J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS.explanation=An error occured when the JVM attempted to run delayed identity operations.
J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS.explanation=An error occurred when the JVM attempted to run delayed identity operations.
J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS.system_action=The JVM will throw a RestoreException.
J9NLS_JCL_CRIU_FAILED_DELAY_LOCK_RELATED_OPS.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED=Cannot set CRIU unprivileged mode, errno=%li
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED.sample_input_1=1
J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED.explanation=An error occured when the JVM attempted set CRIU unprivileged mode.
J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED.explanation=An error occurred when the JVM attempted set CRIU unprivileged mode.
J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED.system_action=The JVM will throw a SystemCheckpointException.
J9NLS_JCL_CRIU_CANNOT_SET_UNPRIVILEGED.user_response=Ensure that CRIU supports unprivileged mode.
# END NON-TRANSLATABLE

J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA=A negative value calculated for checkpointRestoreTimeDelta =%zd
# START NON-TRANSLATABLE
J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA.sample_input_1=1
J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA.explanation=checkpointRestoreTimeDelta is expectd not to be negative.
J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA.explanation=checkpointRestoreTimeDelta is expected not to be negative.
J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA.system_action=The JVM will throw a RestoreException.
J9NLS_JCL_CRIU_NEGATIVE_CHECKPOINT_RESTORE_TIME_DELTA.user_response=View CRIU documentation to determine how to resolve the error.
# END NON-TRANSLATABLE
Expand Down
3 changes: 3 additions & 0 deletions runtime/oti/j9.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ static const struct { \

#define J9_IS_STRING_DESCRIPTOR(str, strLen) (((strLen) > 2) && (IS_REF_OR_VAL_SIGNATURE(*(str))) && (';' == *((str) + (strLen) - 1)))

#if defined(J9VM_OPT_CRIU_SUPPORT)
#define J9_IS_SINGLE_THREAD_MODE(vm) (J9_ARE_ALL_BITS_SET((vm)->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_CRIU_SINGLE_THREAD_MODE))
#define J9_IS_CRIU_RESTORED(vm) (0 != vm->checkpointState.checkpointRestoreTimeDelta)
#endif /* defined(J9VM_OPT_CRIU_SUPPORT) */

#define J9_IS_HIDDEN_METHOD(method) \
((NULL != (method)) && (J9ROMCLASS_IS_ANON_OR_HIDDEN(J9_CLASS_FROM_METHOD((method))->romClass) || J9_ARE_ANY_BITS_SET(J9_ROM_METHOD_FROM_RAM_METHOD((method))->modifiers, J9AccMethodFrameIteratorSkip)))
Expand Down
4 changes: 2 additions & 2 deletions runtime/oti/j9nonbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4799,9 +4799,9 @@ typedef struct J9InternalVMFunctions {
void ( *invalidJITReturnAddress)(J9StackWalkState *walkState) ;
struct J9ClassLoader* ( *internalAllocateClassLoader)(struct J9JavaVM *javaVM, j9object_t classLoaderObject) ;
void ( *initializeClass)(struct J9VMThread *currentThread, struct J9Class *clazz) ;
void ( *threadParkImpl)(struct J9VMThread* vmThread, IDATA timeoutIsEpochRelative, I_64 timeout) ;
void ( *threadParkImpl)(struct J9VMThread* vmThread, BOOLEAN timeoutIsEpochRelative, I_64 timeout) ;
void ( *threadUnparkImpl)(struct J9VMThread* vmThread, j9object_t threadObject) ;
IDATA ( *monitorWaitImpl)(struct J9VMThread* vmThread, j9object_t object, I_64 millis, I_32 nanos, UDATA interruptable) ;
IDATA ( *monitorWaitImpl)(struct J9VMThread* vmThread, j9object_t object, I_64 millis, I_32 nanos, BOOLEAN interruptable) ;
IDATA ( *threadSleepImpl)(struct J9VMThread* vmThread, I_64 millis, I_32 nanos) ;
omrthread_monitor_t ( *getMonitorForWait)(struct J9VMThread* vmThread, j9object_t object) ;
void ( *jvmPhaseChange)(struct J9JavaVM* vm, UDATA phase) ;
Expand Down
51 changes: 48 additions & 3 deletions runtime/oti/vm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ extern "C" {
#define J9_CREATEJAVAVM_ARGENCODING_PLATFORM 8
#define J9_CREATEJAVAVM_START_JITSERVER 16

#define HELPER_TYPE_MONITOR_WAIT_INTERRUPTABLE 1
#define HELPER_TYPE_MONITOR_WAIT_TIMED 2
#define HELPER_TYPE_THREAD_PARK 3
#define HELPER_TYPE_THREAD_SLEEP 4

typedef struct J9CreateJavaVMParams {
UDATA j2seVersion;
char* j2seRootDirectory;
Expand Down Expand Up @@ -4664,17 +4669,57 @@ initializeClass(J9VMThread *currentThread, J9Class *clazz);

/* -------------------- threadpark.c ------------ */

/**
* @param[in] vmThread the current thread
* @param[in] timeoutIsEpochRelative is the timeout in milliseconds relative to the beginning of the epoch
* @param[in] timeout nanosecond or millisecond timeout
*/
void
threadParkImpl (J9VMThread* vmThread, IDATA timeoutIsEpochRelative, I_64 timeout);
threadParkImpl(J9VMThread *vmThread, BOOLEAN timeoutIsEpochRelative, I_64 timeout);
void
threadUnparkImpl (J9VMThread* vmThread, j9object_t threadObject);

/* -------------------- threadhelp.cpp ------------ */

/**
* A time compensation helper for Object.wait(), Thread.sleep(), and Unsafe.park().
* No time compensation for these APIs if CRIU is disabled.
*
* @param[in] vmThread the current thread
* @param[in] threadHelperType the helper type
* HELPER_TYPE_MONITOR_WAIT_INTERRUPTABLE - omrthread_monitor_wait_interruptable
* HELPER_TYPE_MONITOR_WAIT_TIMED - omrthread_monitor_wait_timed
* HELPER_TYPE_THREAD_PARK - omrthread_park
* HELPER_TYPE_THREAD_SLEEP - omrthread_sleep_interruptable
* @param[in] monitor the object monitor waiting on
* @param[in] millis milliseconds timeout
* @param[in] nanos nanosecond timeout
*/
IDATA
timeCompensationHelper(J9VMThread *vmThread, U_8 threadHelperType, omrthread_monitor_t monitor, I_64 millis, I_32 nanos);

/**
* @param[in] vmThread current thread
* @param[in] object the object to wait on
* @param[in] millis millisecond timeout
* @param[in] nanos nanosecond timeout
* @param[in] interruptable set to FALSE to ignore interrupts
*
* @return 0 on success, non-zero on failure. This function always sets the current exception on failure.
*/
IDATA
monitorWaitImpl(J9VMThread *vmThread, j9object_t object, I_64 millis, I_32 nanos, UDATA interruptable);
monitorWaitImpl(J9VMThread *vmThread, j9object_t object, I_64 millis, I_32 nanos, BOOLEAN interruptable);

/**
* @param[in] vmThread current thread
* @param[in] millis millisecond timeout
* @param[in] nanos nanosecond timeout
*
* @return 0 on success, non-zero on failure. This function always sets the current exception on failure.
*/
IDATA
threadSleepImpl(J9VMThread* vmThread, I_64 millis, I_32 nanos);
threadSleepImpl(J9VMThread *vmThread, I_64 millis, I_32 nanos);

omrthread_monitor_t
getMonitorForWait (J9VMThread* vmThread, j9object_t object);
/**
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/FastJNI_sun_misc_Unsafe.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2001, 2014 IBM Corp. and others
* Copyright (c) 2001, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -31,7 +31,7 @@ extern "C" {
void JNICALL
Fast_sun_misc_Unsafe_park(J9VMThread *currentThread, jboolean isAbsolute, jlong time)
{
threadParkImpl(currentThread, (IDATA)isAbsolute, (I_64)time);
threadParkImpl(currentThread, isAbsolute ? TRUE : FALSE, (I_64)time);
}

/* sun.misc.Unsafe: public native void unpark(java.lang.Object thread); */
Expand Down
Loading

0 comments on commit 88207cc

Please sign in to comment.