* FIXME: Not optimal, maybe we should have two native functions.
* @param millis the length of time to sleep in milliseconds.
*/
- public static void sleep(long millis) {
+ public static void sleep(long millis) throws HostFailureException {
sleep(millis,0);
}
/**
* @param millis the length of time to sleep in milliseconds.
* @param nanos additionnal nanoseconds to sleep.
*/
- public native static void sleep(long millis, int nanos);
+ public native static void sleep(long millis, int nanos) throws HostFailureException;
/**
* Makes the current process sleep until time seconds have elapsed.
* @param seconds The time the current process must sleep.
*/
- public native void waitFor(double seconds);
+ public native void waitFor(double seconds) throws HostFailureException;
/**
*
*/
CATCH_ANONYMOUS {
return;
}
- jxbt_check_res("MSG_process_sleep()", rv, MSG_OK,
- bprintf("unexpected error , please report this bug"));
+ if (rv != MSG_OK) {
+ jmsg_throw_status(env,rv);
+ }
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_waitFor(JNIEnv * env, jobject jprocess,
return;
}
if (rv != MSG_OK) {
-// smx_ctx_java_stop(smx_ctx_java_self());
+ XBT_INFO("Status NOK");
+ jmsg_throw_status(env,rv);
}
}