Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 22 Jun 2016 20:32:13 +0000 (22:32 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 22 Jun 2016 20:32:13 +0000 (22:32 +0200)
1  2 
src/simix/smx_process.cpp

@@@ -754,7 -754,7 +754,7 @@@ xbt_dict_t SIMIX_process_get_properties
  void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout)
  {
    if (process->finished) {
 -    // The process is already finished, just wake up the process right now:
 +    // The joined process is already finished, just wake up the issuer process right away
      simcall_process_sleep__set__result(simcall, SIMIX_DONE);
      SIMIX_simcall_answer(simcall);
      return;
@@@ -786,13 -786,14 +786,14 @@@ static int SIMIX_process_join_finish(sm
      sleep->surf_sleep->unref();
      sleep->surf_sleep = nullptr;
    }
-   delete sleep;
+   sleep->unref();
    return 0;
  }
  
  smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
  {
    smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
+   static_cast<simgrid::simix::Synchro*>(res)->ref();
    SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
    return res;
  }
@@@ -835,6 -836,7 +836,7 @@@ void SIMIX_process_sleep_destroy(smx_sy
    if (sleep->surf_sleep) {
      sleep->surf_sleep->unref();
      sleep->surf_sleep = nullptr;
+     sleep->unref();
    }
  }