- * The Task reception functions *
- ***************************************************************************************/
-
-JNIEXPORT jobject JNICALL
-Java_simgrid_msg_MsgNative_taskGet(JNIEnv * env, jclass cls,
- jint chan_id, jdouble jtimeout,
- jobject jhost)
-{
- m_task_t task = NULL;
- m_host_t host = NULL;
-
- if (jhost) {
- host = jhost_get_native(env, jhost);
- if (!host) {
- jxbt_throw_notbound(env, "host", jhost);
- return NULL;
- }
- }
-
- if (MSG_OK !=
- MSG_task_get_ext(&task, (int) chan_id, (double) jtimeout, host)) {
- jxbt_throw_native(env, xbt_strdup("MSG_task_get_ext() failed"));
- return NULL;
- }
-
- return (jobject) task->data;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_simgrid_msg_MsgNative_taskProbe(JNIEnv * env, jclass cls, jint chan_id)
-{
- return (jboolean) MSG_task_Iprobe(chan_id);
-}
-
-JNIEXPORT jobject JNICALL
-Java_simgrid_msg_MsgNative_taskGetCommunicatingProcess(JNIEnv * env,
- jclass cls,
- jint chan_id)
-{
- int pid = MSG_task_probe_from(chan_id);
- if (pid >= 0)
- return Java_simgrid_msg_MsgNative_processFromPID(env, cls, (jint) pid);
-
- return NULL;
-}
-
-JNIEXPORT jint JNICALL
-Java_simgrid_msg_MsgNative_taskProbeHost(JNIEnv * env, jclass cls,
- jobject jhost, jint chan_id)
-{
- m_host_t host = jhost_get_native(env, jhost);
-
- if (!host) {
- jxbt_throw_notbound(env, "host", jhost);
- return -1;
- }
-
- return (jint) MSG_task_probe_from_host(chan_id, host);
-}
-
-
-/***************************************************************************************
- * The Task reception functions *