From: Martin Quinson Date: Wed, 25 Apr 2012 22:41:43 +0000 (+0200) Subject: check error conditions of task receiption [Samuel Lepetit] X-Git-Tag: v3_9_90~569^2~19^2~127 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/97e7dc89c1d397f75190bef4bc4ac67bfcbcea1a?hp=1d3c68b8524b83dbbb64048a5078eeffedd2722a check error conditions of task receiption [Samuel Lepetit] --- diff --git a/src/jmsg.c b/src/jmsg.c index f10f465b1c..323d3aa4e4 100644 --- a/src/jmsg.c +++ b/src/jmsg.c @@ -1071,6 +1071,22 @@ Java_org_simgrid_msg_MsgNative_taskReceive(JNIEnv * env, jclass cls, alias = (*env)->GetStringUTFChars(env, jalias, 0); rv = MSG_task_receive_ext(&task, alias, (double) jtimeout, host); + if (rv != MSG_OK) { + switch (rv) { + case MSG_TIMEOUT: + jxbt_throw_time_out_failure(env,NULL); + break; + case MSG_TRANSFER_FAILURE: + jxbt_throw_transfer_failure(env,NULL); + break; + case MSG_HOST_FAILURE: + jxbt_throw_host_failure(env,NULL); + break; + default: + jxbt_throw_native(env,bprintf("receive failed")); + } + return NULL; + } jtask_global = MSG_task_get_data(task); /* Convert the global ref into a local ref so that the JVM can free the stuff */