- /*FIXME: is this really necessary? Seems to. */
- if (my_current_context->iwannadie) {
- XBT_INFO("I wannadie");
- /* The maestro call xbt_context_stop() with an exit code set to one */
- if (ctx_java->jprocess) {
- /* if the java process is alive schedule it */
- if (jprocess_is_alive(ctx_java->jprocess, get_current_thread_env())) {
- jprocess_schedule(my_current_context);
- jprocess = ctx_java->jprocess;
- ctx_java->jprocess = NULL;
-
- /* interrupt the java process */
- jprocess_exit(jprocess, get_current_thread_env());
- }
- }
- } else {
- /* the java process exits */
- jprocess = ctx_java->jprocess;
- ctx_java->jprocess = NULL;
- }
-
- /* delete the global reference associated with the java process */
- jprocess_delete_global_ref(jprocess, get_current_thread_env());
+ /* suspend myself again, smx_ctx_java_free() will destroy me later
+ * from maeastro */
+ jprocess_unschedule(context);
+ XBT_INFO("Java stop finished");