]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-05-19 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Thu, 19 May 2005 01:30:53 +0000 (01:30 +0000)
committerpaul <paul>
Thu, 19 May 2005 01:30:53 +0000 (01:30 +0000)
* thread.c: (thread_cancel_event) the number of pending events
  cancelled is potentially useful information, dont throw it away,
  pass it back to the caller.

lib/ChangeLog
lib/thread.c
lib/thread.h

index 5a0eff55cd4242a1aad849c8ef127e3ce6d8a097..82ea6fd1d3a089fd1dbd99fd0012cac3edc0458b 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-19 Paul Jakma <paul@dishone.st>
+
+       * thread.c: (thread_cancel_event) the number of pending events
+         cancelled is potentially useful information, dont throw it away,
+         pass it back to the caller.
+
 2005-05-15 Paul Jakma <paul@dishone.st>
 
        * getopt.h: It's not just __GNU_LIBRARY__ which defines
index a18db25a3bfaa5632bb36075ccdd6e1d5208f3c0..32fc15efdd3357e9f902a3a50ce69408c0c8e26e 100644 (file)
@@ -663,9 +663,10 @@ thread_cancel (struct thread *thread)
 }
 
 /* Delete all events which has argument value arg. */
-void
+unsigned int
 thread_cancel_event (struct thread_master *m, void *arg)
 {
+  unsigned int ret = 0;
   struct thread *thread;
 
   thread = m->event.head;
@@ -678,11 +679,13 @@ thread_cancel_event (struct thread_master *m, void *arg)
 
       if (t->arg == arg)
         {
+          ret++;
           thread_list_delete (&m->event, t);
           t->type = THREAD_UNUSED;
           thread_add_unuse (m, t);
         }
     }
+  return ret;
 }
 
 static struct timeval *
index 4a3bbbe51a936afaf48b7a7adb595391dc578bf4..f693ff5ab5d4a0db218e224c94cc14e0486827fa 100644 (file)
@@ -185,7 +185,7 @@ extern struct thread *funcname_thread_execute (struct thread_master *,
                                                int (*)(struct thread *),
                                                void *, int, const char *);
 extern void thread_cancel (struct thread *);
-extern void thread_cancel_event (struct thread_master *, void *);
+extern unsigned int thread_cancel_event (struct thread_master *, void *);
 extern struct thread *thread_fetch (struct thread_master *, struct thread *);
 extern void thread_call (struct thread *);
 extern unsigned long thread_timer_remain_second (struct thread *);