Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix in async example. maybe our code should be more defensive for that kind of...
[simgrid.git] / examples / async / Slave.java
index e2865a7..f1a8fab 100644 (file)
@@ -37,14 +37,16 @@ public class Slave extends Process {
                                                Task task = comm.getTask();
        
                                                if (task instanceof FinalizeTask) {
+                                                       comm = null;
                                                        break;
                                                }
                                                Msg.info("Received \"" + task.getName() +  "\". Processing it.");
                                                try {
                                                        task.execute();
                                                } catch (TaskCancelledException e) {
-                                                       
+                                               
                                                }
+                                               comm = null;                                                    
                                        }
                                        else {
                                                simulatedSleep(1);
@@ -52,7 +54,7 @@ public class Slave extends Process {
                                }
                        }
                        catch (Exception e) {
-
+                               e.printStackTrace();
                        }
                }
                Msg.info("Received Finalize. I'm done. See you!");