A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_process.c
diff --git
a/src/bindings/java/jmsg_process.c
b/src/bindings/java/jmsg_process.c
index
7e40aec
..
ed259b7
100644
(file)
--- a/
src/bindings/java/jmsg_process.c
+++ b/
src/bindings/java/jmsg_process.c
@@
-1,10
+1,11
@@
/* Functions related to the java process instances. */
/* Functions related to the java process instances. */
-/* Copyright (c) 2007-201
2
. The SimGrid Team.
+/* Copyright (c) 2007-201
4
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
#include "jmsg_process.h"
#include "jmsg.h"
#include "jmsg_process.h"
#include "jmsg.h"
@@
-335,7
+336,7
@@
Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env,
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
{
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
{
- double time =
jmillis / 1000 + jnanos / 1
000;
+ double time =
((double)jmillis) / 1000 + ((double)jnanos) / 1000000
000;
msg_error_t rv;
rv = MSG_process_sleep(time);
if (rv != MSG_OK) {
msg_error_t rv;
rv = MSG_process_sleep(time);
if (rv != MSG_OK) {
@@
-348,6
+349,8
@@
Java_org_simgrid_msg_Process_waitFor(JNIEnv * env, jobject jprocess,
{
msg_error_t rv;
rv = MSG_process_sleep((double)jseconds);
{
msg_error_t rv;
rv = MSG_process_sleep((double)jseconds);
+ if ((*env)->ExceptionOccurred(env))
+ return;
if (rv != MSG_OK) {
XBT_DEBUG("Status NOK");
jmsg_throw_status(env,rv);
if (rv != MSG_OK) {
XBT_DEBUG("Status NOK");
jmsg_throw_status(env,rv);
@@
-389,6
+392,7
@@
Java_org_simgrid_msg_Process_migrate(JNIEnv * env,
msg_error_t rv = MSG_process_migrate(process, host);
if (rv != MSG_OK) {
jmsg_throw_status(env,rv);
msg_error_t rv = MSG_process_migrate(process, host);
if (rv != MSG_OK) {
jmsg_throw_status(env,rv);
+ return;
}
/* change the host java side */
(*env)->SetObjectField(env, jprocess, jprocess_field_Process_host, jhost);
}
/* change the host java side */
(*env)->SetObjectField(env, jprocess, jprocess_field_Process_host, jhost);
@@
-401,7
+405,7
@@
Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdoubl
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
- /*
FIXME: t
he next test on SimGrid version is to ensure that this still compiles with SG 3.8 while the C function were added in SG 3.9 only.
+ /*
T
he next test on SimGrid version is to ensure that this still compiles with SG 3.8 while the C function were added in SG 3.9 only.
* This kind of pimple becomes mandatory when you get so slow to release the java version that it begins evolving further after the C release date.
*/
#if SIMGRID_VERSION >= 30900
* This kind of pimple becomes mandatory when you get so slow to release the java version that it begins evolving further after the C release date.
*/
#if SIMGRID_VERSION >= 30900