X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d7f817f1d9a3b1572b38300d6a7eeadfbcc1ad1f..32892d0df7206a7c14ace5a13f985df1e0a9249a:/src/bindings/java/jmsg_synchro.cpp?ds=sidebyside diff --git a/src/bindings/java/jmsg_synchro.cpp b/src/bindings/java/jmsg_synchro.cpp index 4fd0836f6d..e79910ce4b 100644 --- a/src/bindings/java/jmsg_synchro.cpp +++ b/src/bindings/java/jmsg_synchro.cpp @@ -1,21 +1,18 @@ /* Java bindings of the Synchronization API. */ -/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2018. The SimGrid Team. 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. */ -#include - -#include "jmsg.h" #include "jmsg_synchro.h" -#include "jxbt_utilities.h" +#include "jmsg.hpp" +#include "jxbt_utilities.hpp" +#include "simgrid/Exception.hpp" #include "xbt/synchro.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java); -SG_BEGIN_DECL() - static jfieldID jsynchro_field_Mutex_bind; JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass cls) { @@ -33,9 +30,8 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject xbt_mutex_t mutex = (xbt_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind); try { xbt_mutex_acquire(mutex); - } - catch(xbt_ex& e) { - // Nothing to do + } catch (xbt_ex const& e) { + XBT_DEBUG("Caught an exception: %s", e.what()); } } @@ -95,5 +91,3 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * en sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind); MSG_sem_destroy(sem); } - -SG_END_DECL()