diff options
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/thread.h b/lib/thread.h index c22b2105cd..e2b7763c51 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -147,18 +147,15 @@ struct cpu_thread_history { #define THREAD_FD(X) ((X)->u.fd) #define THREAD_VAL(X) ((X)->u.val) -#define THREAD_OFF(thread) \ - do { \ - if (thread) { \ - thread_cancel(thread); \ - thread = NULL; \ - } \ +/* + * Please consider this macro deprecated, and do not use it in new code. + */ +#define THREAD_OFF(thread) \ + do { \ + if ((thread)) \ + thread_cancel(&(thread)); \ } while (0) -#define THREAD_READ_OFF(thread) THREAD_OFF(thread) -#define THREAD_WRITE_OFF(thread) THREAD_OFF(thread) -#define THREAD_TIMER_OFF(thread) THREAD_OFF(thread) - #define debugargdef const char *funcname, const char *schedfrom, int fromln #define thread_add_read(m,f,a,v,t) funcname_thread_add_read_write(THREAD_READ,m,f,a,v,t,#f,__FILE__,__LINE__) @@ -207,7 +204,7 @@ extern void funcname_thread_execute(struct thread_master *, debugargdef); #undef debugargdef -extern void thread_cancel(struct thread *); +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 *); |
