Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cancelling a non-running task: show a warning only once
authorChristophe Thiéry <christopho128@gmail.com>
Mon, 25 Jul 2011 13:33:35 +0000 (15:33 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Mon, 25 Jul 2011 13:33:35 +0000 (15:33 +0200)
src/msg/task.c

index 6d3065f..2a9a5c0 100644 (file)
@@ -203,7 +203,11 @@ MSG_error_t MSG_task_cancel(m_task_t task)
     SIMIX_req_comm_cancel(task->simdata->comm);
   }
   else {
-    XBT_DEBUG("Task %p will not be cancelled since it is not running", task);
+    static int warned = 0;
+    if (!warned) {
+      XBT_WARN("Cannot cancel a non-running task");
+      warned = 1;
+    }
   }
   return MSG_OK;
 }