diff options
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/thread.h b/lib/thread.h index b23c6a9865..af68331131 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -41,13 +41,13 @@ struct rusage_t { #define GETRUSAGE(X) thread_getrusage(X) -PREDECL_LIST(thread_list) -PREDECL_HEAP(thread_timer_list) +PREDECL_LIST(thread_list); +PREDECL_HEAP(thread_timer_list); struct fd_handler { /* number of pfd that fit in the allocated space of pfds. This is a - * constant - * and is the same for both pfds and copy. */ + * constant and is the same for both pfds and copy. + */ nfds_t pfdsize; /* file descriptors to monitor for i/o */ @@ -61,12 +61,6 @@ struct fd_handler { nfds_t copycount; }; -struct cancel_req { - struct thread *thread; - void *eventobj; - struct thread **threadref; -}; - struct xref_threadsched { struct xref xref; @@ -191,7 +185,7 @@ struct cpu_thread_history { #define thread_add_timer(m,f,a,v,t) _xref_t_a(timer, TIMER, m,f,a,v,t) #define thread_add_timer_msec(m,f,a,v,t) _xref_t_a(timer_msec, TIMER, m,f,a,v,t) #define thread_add_timer_tv(m,f,a,v,t) _xref_t_a(timer_tv, TIMER, m,f,a,v,t) -#define thread_add_event(m,f,a,v,t) _xref_t_a(event, TIMER, m,f,a,v,t) +#define thread_add_event(m,f,a,v,t) _xref_t_a(event, EVENT, m,f,a,v,t) #define thread_execute(m,f,a,v) \ ({ \ @@ -240,7 +234,10 @@ extern void _thread_execute(const struct xref_threadsched *xref, extern void thread_cancel(struct thread **event); extern void thread_cancel_async(struct thread_master *, struct thread **, void *); -extern void thread_cancel_event(struct thread_master *, void *); +/* Cancel ready tasks with an arg matching 'arg' */ +extern void thread_cancel_event_ready(struct thread_master *m, void *arg); +/* Cancel all tasks with an arg matching 'arg', including timers and io */ +extern void thread_cancel_event(struct thread_master *m, void *arg); 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 *); |
