Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't define variables in header file.!
[simgrid.git] / src / bindings / java / jmsg_process.c
index aaa73e7..300c773 100644 (file)
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
 
+jfieldID jprocess_field_Process_bind;
+jfieldID jprocess_field_Process_host;
+jfieldID jprocess_field_Process_killTime;
+jfieldID jprocess_field_Process_id;
+jfieldID jprocess_field_Process_name;
+jfieldID jprocess_field_Process_pid;
+jfieldID jprocess_field_Process_ppid;
+
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_exit(JNIEnv *env, jobject jprocess) {
   if (smx_factory_initializer_to_use == SIMIX_ctx_cojava_factory_init) {
@@ -321,21 +329,13 @@ 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) {
-
-       double time =  jmillis / 1000 + jnanos / 1000;
-       msg_error_t rv;
-       xbt_ex_t e;
-       TRY {
-               rv = MSG_process_sleep(time);
-       }
-       CATCH(e) {
-           xbt_ex_free(e);
-               return;
-       }
+Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
+ {
+  double time =  jmillis / 1000 + jnanos / 1000;
+  msg_error_t rv;
+  rv = MSG_process_sleep(time);
   if (rv != MSG_OK) {
-       jmsg_throw_status(env,rv);
+    jmsg_throw_status(env,rv);
   }
 }
 JNIEXPORT void JNICALL
@@ -343,17 +343,10 @@ Java_org_simgrid_msg_Process_waitFor(JNIEnv * env, jobject jprocess,
                                      jdouble jseconds)
 {
   msg_error_t rv;
-  xbt_ex_t e;
-  TRY {
-   rv = MSG_process_sleep((double)jseconds);
-  }
-  CATCH(e) {
-    xbt_ex_free(e);
-       return;
-  }
+  rv = MSG_process_sleep((double)jseconds);
   if (rv != MSG_OK) {
-       XBT_INFO("Status NOK");
-       jmsg_throw_status(env,rv);
+    XBT_INFO("Status NOK");
+    jmsg_throw_status(env,rv);
   }
 }