X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63d0c052edbfe9ae6efcc4fd896470790d01cbbc..615f07c63982de3e1e9ae73b61964efa6825694d:/src/bindings/java/jmsg_synchro.cpp diff --git a/src/bindings/java/jmsg_synchro.cpp b/src/bindings/java/jmsg_synchro.cpp index e79910ce4b..18563429d1 100644 --- a/src/bindings/java/jmsg_synchro.cpp +++ b/src/bindings/java/jmsg_synchro.cpp @@ -64,7 +64,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_acquire(JNIEnv * env, jobj msg_sem_t sem; sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind); - msg_error_t res = MSG_sem_acquire_timeout(sem, (double) timeout); + msg_error_t res = MSG_sem_acquire_timeout(sem, (double)timeout) == 0 ? MSG_OK : MSG_TIMEOUT; if (res != MSG_OK) { jmsg_throw_status(env, res); }