- if (context->cleanup_func)
- (*(context->cleanup_func)) (context->data);
-
- ctx_java = (smx_ctx_java_t) context;
-
- /*FIXME: is this really necessary? DIRTY HACK: let's comment it and see*/
-// if (((smx_process_t)smx_current_context->data)->iwannadie) {
- /* 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(smx_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_die("This function was not supposed to return");