X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/14b60cad3005c71ebc2d752dbdff94da9b64dde0..91bb8b44ef09735fc79f40a3d9eeb69456a46909:/src/bindings/java/jmsg_synchro.c diff --git a/src/bindings/java/jmsg_synchro.c b/src/bindings/java/jmsg_synchro.c index 3bc4fcce1f..2fd40e4014 100644 --- a/src/bindings/java/jmsg_synchro.c +++ b/src/bindings/java/jmsg_synchro.c @@ -1,9 +1,10 @@ /* Functions exporting the simgrid synchronization mechanisms to the Java world */ -/* Copyright (c) 2012. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2013. 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. */ + * under the terms of the license (GNU LGPL) which comes with this package. */ #include "jmsg.h" #include "xbt/synchro_core.h" @@ -81,8 +82,11 @@ Java_org_simgrid_msg_Semaphore_acquire(JNIEnv * env, jobject obj, jdouble timeou sem = (msg_sem_t) (long) (*env)->GetLongField(env, obj, jsyncro_field_Semaphore_bind); msg_error_t res = MSG_sem_acquire_timeout(sem, (double) timeout); - jmsg_throw_status(env, res); + if (res != MSG_OK) { + jmsg_throw_status(env, res); + } } + JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_release(JNIEnv * env, jobject obj) { msg_sem_t sem;