From dc81807a5b2b3dc8138d74e23ece71402a6c03b4 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 19 May 2005 01:30:53 +0000 Subject: 2005-05-19 Paul Jakma * 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 | 6 ++++++ lib/thread.c | 5 ++++- lib/thread.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/ChangeLog b/lib/ChangeLog index 5a0eff55..82ea6fd1 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2005-05-19 Paul Jakma + + * 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 * getopt.h: It's not just __GNU_LIBRARY__ which defines diff --git a/lib/thread.c b/lib/thread.c index a18db25a..32fc15ef 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -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 * diff --git a/lib/thread.h b/lib/thread.h index 4a3bbbe5..f693ff5a 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -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 *); -- cgit v1.2.1