summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorpaul <paul>2005-05-19 01:30:53 +0000
committerpaul <paul>2005-05-19 01:30:53 +0000
commitdc81807a5b2b3dc8138d74e23ece71402a6c03b4 (patch)
tree7f2850cf793ea8c5241b85b18e971bd763707f14 /lib/thread.c
parenta3387a4488c35d322d3c78973c967b2be5967b6e (diff)
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.
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c5
1 files changed, 4 insertions, 1 deletions
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 *