- jobject jprocess = NULL;
- fprintf(stderr,"XXXX Context Stop\n");
-
- smx_ctx_java_t ctx_java;
-
- if (context->cleanup_func)
- (*(context->cleanup_func)) (context->data);
-
- ctx_java = (smx_ctx_java_t) context;
-
- /*FIXME: is this really necessary? Seems to. */
- if (smx_current_context->iwannadie) {
- INFO0("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(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;
- }
+ xbt_assert(context == my_current_context,
+ "The context to stop must be the current one");
+ /* I am the current process and I am dying */
+ smx_ctx_base_stop(context);
+
+ XBT_DEBUG("I am dying");