Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Directly reset observer_ instead of using an empty simcall for that.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Mar 2022 09:45:54 +0000 (10:45 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Mar 2022 09:45:54 +0000 (10:45 +0100)
src/kernel/actor/ActorImpl.cpp
teshsuite/java/sleephostoff/sleephostoff.tesh

index e0129d4..2542751 100644 (file)
@@ -194,8 +194,9 @@ void ActorImpl::cleanup_from_self()
     simcall_.timeout_cb_ = nullptr;
   }
 
-  set_wannadie(false); // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-  actor::simcall_answered([] {}); // This empty callback is mandatory even if it drives me nuts.
+  /* maybe the actor was killed during a simcall, reset its observer */
+  simcall_.observer_ = nullptr;
+
   set_wannadie();
 }
 
index 69d0e1d..46ca604 100644 (file)
@@ -6,7 +6,7 @@ $ ${javacmd:=java} -classpath ${classpath:=.} sleephostoff.SleepHostOff ${srcdir
 > [  0.010000] (2:Sleeper@Tremblay) I'm not dead
 > [  0.020000] (1:TestRunner@Fafard) Stop Tremblay
 > [  0.020000] (2:Sleeper@Tremblay) I'm not dead
-> [  0.020000] (1:TestRunner@Fafard) Tremblay has been stopped
 > [  0.020000] (2:Sleeper@Tremblay) catch HostFailureException: Host Failure
+> [  0.020000] (1:TestRunner@Fafard) Tremblay has been stopped
 > [  0.320000] (1:TestRunner@Fafard) Test sleep seems ok, cool! (number of Process : 1, it should be 1 (i.e. the Test one))
 > [  0.320000] (0:maestro@) Terminating the simulation...