more extensive error reporting
authorChristian Grothoff <christian@grothoff.org>
Wed, 25 May 2011 21:40:07 +0000 (21:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 25 May 2011 21:40:07 +0000 (21:40 +0000)
src/util/scheduler.c

index 2f300f4bd6030939086a9ed135f3b00e57fc7405..81f7d8cf045e2e794a75030d29d0bf57d19c2d19 100644 (file)
@@ -911,7 +911,13 @@ GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task)
   while (t == NULL)
     {
       p++;
-      GNUNET_assert (p < GNUNET_SCHEDULER_PRIORITY_COUNT);
+      if (p >= GNUNET_SCHEDULER_PRIORITY_COUNT)
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     _("Attempt to cancel dead task %llu!\n"),
+                     (unsigned long long) task);
+         GNUNET_assert (0);
+       }
       prev = NULL;
       t = ready[p];
       while (t != NULL)