X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85..12481182b50742100ff082caace772c17b593bbe:/src/bindings/java/jmsg_synchro.cpp diff --git a/src/bindings/java/jmsg_synchro.cpp b/src/bindings/java/jmsg_synchro.cpp index e79910ce4b..b6d3f6d3d5 100644 --- a/src/bindings/java/jmsg_synchro.cpp +++ b/src/bindings/java/jmsg_synchro.cpp @@ -1,6 +1,6 @@ /* Java bindings of the Synchronization API. */ -/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2019. 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. */ @@ -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); }