Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://github.com/mpoquet/simgrid
[simgrid.git] / src / bindings / java / jmsg_synchro.cpp
index ca24ac8..7caebe7 100644 (file)
@@ -6,10 +6,12 @@
 /* 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. */
 
+#include <xbt/ex.hpp>
+
 #include "jmsg.h"
-#include "xbt/synchro_core.h"
 #include "jmsg_synchro.h"
 #include "jxbt_utilities.h"
+#include "xbt/synchro.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
 
@@ -29,15 +31,12 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_init(JNIEnv * env, jobject obj
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject obj) {
-  xbt_mutex_t mutex;
-
-  mutex = (xbt_mutex_t) (uintptr_t) env->GetLongField(obj, jsyncro_field_Mutex_bind);
-  xbt_ex_t e;
-  TRY {
+  xbt_mutex_t mutex = (xbt_mutex_t) (uintptr_t) env->GetLongField(obj, jsyncro_field_Mutex_bind);
+  try {
     xbt_mutex_acquire(mutex);
   }
-  CATCH(e) {
-    xbt_ex_free(e);
+  catch(xbt_ex& e) {
+    // Nothing to do
   }
 }