Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar: also ignore S5271 for the examples in C++
[simgrid.git] / src / msg / msg_legacy.cpp
index 3e25d7647813ed08be457e0e73dd20a209e3cf64..c76bad3dadab5fee2470d775db470f5d960ab8d9 100644 (file)
@@ -55,7 +55,9 @@ int MSG_task_listen(const char* alias)
 /* ************************** Actors *************************** */
 void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data)
 {
-  sg_actor_on_exit(fun, data);
+  /* We can't use the sg_actor_on_exit, as the return type of the callback changed: the int in MSG is ignored and was
+   * removed in sg */
+  simgrid::s4u::this_actor::on_exit([fun, data](bool failed) { fun(failed ? 1 /*FAILURE*/ : 0 /*SUCCESS*/, data); });
 }
 
 int MSG_process_get_PID(const_sg_actor_t actor)