* 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-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
}
/* 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;
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 *
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 *);