Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Process bind bugfix
authorSamuel Lepetit <samuel.lepetit@inria.fr>
Mon, 11 Jun 2012 15:40:15 +0000 (17:40 +0200)
committerSamuel Lepetit <samuel.lepetit@inria.fr>
Mon, 11 Jun 2012 15:40:15 +0000 (17:40 +0200)
src/smx_context_java.c

index b327df5..a68ebea 100644 (file)
@@ -1,6 +1,6 @@
 /* context_java - implementation of context switching for java threads */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009, 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -99,6 +99,10 @@ static void* smx_ctx_java_thread_run(void *data) {
        if (context->super.argc > 0) {
                (*(context->super.code))(context->super.argc, context->super.argv);
        }
+       else {
+               smx_process_t process = SIMIX_process_self();
+               (*env)->SetLongField(env, context->jprocess, jprocess_field_Process_bind, (jlong)process);
+       }
        xbt_assert((context->jprocess != NULL), "Process not created...");
   //wait for the process to be able to begin
   //TODO: Cache it