void jprocess_join(jobject jprocess, JNIEnv * env)
{
msg_process_t process = jprocess_to_native_process(jprocess,env);
void jprocess_join(jobject jprocess, JNIEnv * env)
{
msg_process_t process = jprocess_to_native_process(jprocess,env);
xbt_os_thread_join(context->thread,NULL);
}
msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env)
{
xbt_os_thread_join(context->thread,NULL);
}
msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env)
{
jclass jprocess_class_Process = env->FindClass("org/simgrid/msg/Process");
jprocess_field_Process_name = jxbt_get_jfield(env, jprocess_class_Process, "name", "Ljava/lang/String;");
jclass jprocess_class_Process = env->FindClass("org/simgrid/msg/Process");
jprocess_field_Process_name = jxbt_get_jfield(env, jprocess_class_Process, "name", "Ljava/lang/String;");
jprocess_field_Process_ppid = jxbt_get_jfield(env, jprocess_class_Process, "ppid", "I");
jprocess_field_Process_host = jxbt_get_jfield(env, jprocess_class_Process, "host", "Lorg/simgrid/msg/Host;");
jprocess_field_Process_killTime = jxbt_get_jfield(env, jprocess_class_Process, "killTime", "D");
jprocess_field_Process_ppid = jxbt_get_jfield(env, jprocess_class_Process, "ppid", "I");
jprocess_field_Process_host = jxbt_get_jfield(env, jprocess_class_Process, "host", "Lorg/simgrid/msg/Host;");
jprocess_field_Process_killTime = jxbt_get_jfield(env, jprocess_class_Process, "killTime", "D");
- if (!jprocess_class_Process || !jprocess_field_Process_id || !jprocess_field_Process_name || !jprocess_field_Process_pid ||
- !jprocess_field_Process_ppid || !jprocess_field_Process_host) {
+ if (!jprocess_class_Process || !jprocess_field_Process_id || !jprocess_field_Process_name ||
+ !jprocess_field_Process_pid || !jprocess_field_Process_ppid || !jprocess_field_Process_host) {
jobject jprocess; /* the global reference to the java process instance */
jstring jname; /* the name of the java process instance */
const char *name; /* the C name of the process */
jobject jprocess; /* the global reference to the java process instance */
jstring jname; /* the name of the java process instance */
const char *name; /* the C name of the process */
/* Retrieve the kill time from the process */
jdouble jkill = env->GetDoubleField(jprocess, jprocess_field_Process_killTime);
/* Actually build the MSG process */
/* Retrieve the kill time from the process */
jdouble jkill = env->GetDoubleField(jprocess, jprocess_field_Process_killTime);
/* Actually build the MSG process */
- process = MSG_process_create_with_environment(name,
- [](int argc, char** argv) -> int {
+ process = MSG_process_create_with_environment(name, [](int argc, char** argv) -> int {
smx_process_t process = SIMIX_process_self();
// This is the jprocess passed as environment.
// It would be simplet if we could use a closure.
smx_process_t process = SIMIX_process_self();
// This is the jprocess passed as environment.
// It would be simplet if we could use a closure.
-JNIEXPORT jobject JNICALL
-Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jclass cls,
- jint PID)
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jclass cls, jint PID)
-JNIEXPORT jobject JNICALL
-Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname) {
+
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname) {
- jxbt_check_res("MSG_process_suspend()", rv, MSG_OK,
- bprintf("unexpected error , please report this bug"));
-
+ jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
- jxbt_check_res("MSG_process_resume()", rv, MSG_OK,
- bprintf("unexpected error , please report this bug"));
+ jxbt_check_res("MSG_process_resume()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
-JNIEXPORT void JNICALL
-Java_org_simgrid_msg_Process_setAutoRestart
- (JNIEnv *env, jobject jprocess, jboolean jauto_restart) {
+JNIEXPORT void
+JNICALL Java_org_simgrid_msg_Process_setAutoRestart (JNIEnv *env, jobject jprocess, jboolean jauto_restart) {
-JNIEXPORT void JNICALL
-Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
{
/* get the native instances from the java ones */
msg_process_t process = jprocess_to_native_process(jprocess, env);
{
/* get the native instances from the java ones */
msg_process_t process = jprocess_to_native_process(jprocess, env);
-JNIEXPORT void JNICALL
-Java_org_simgrid_msg_Process_migrate(JNIEnv * env,
- jobject jprocess, jobject jhost)
+
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate(JNIEnv * env, jobject jprocess, jobject jhost)
/* change the host java side */
env->SetObjectField(jprocess, jprocess_field_Process_host, jhost);
}
/* change the host java side */
env->SetObjectField(jprocess, jprocess_field_Process_host, jhost);
}
-JNIEXPORT void JNICALL
-Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) {
+
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) {
msg_process_t process = jprocess_to_native_process(jprocess, env);
MSG_process_set_kill_time(process, (double)jkilltime);
}
msg_process_t process = jprocess_to_native_process(jprocess, env);
MSG_process_set_kill_time(process, (double)jkilltime);
}