summaryrefslogtreecommitdiff
path: root/lib/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.h')
-rw-r--r--lib/thread.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/thread.h b/lib/thread.h
index 86f839810f..e48068b174 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -47,16 +47,25 @@ struct pqueue;
struct fd_handler
{
- /* number of pfd stored in pfds */
- nfds_t pfdcount;
- /* number of pfd stored in pfds + number of snmp pfd */
- nfds_t pfdcountsnmp;
- /* number of pfd that fit in the allocated space of pfds */
+ /* number of pfd that fit in the allocated space of pfds. This is a constant
+ * and is the same for both pfds and copy. */
nfds_t pfdsize;
+
/* file descriptors to monitor for i/o */
struct pollfd *pfds;
+ /* number of pollfds stored in pfds */
+ nfds_t pfdcount;
+
/* chunk used for temp copy of pollfds */
struct pollfd *copy;
+ /* number of pollfds stored in copy */
+ nfds_t copycount;
+};
+
+struct cancel_req {
+ struct thread *thread;
+ void *eventobj;
+ struct thread **threadref;
};
/* Master of the theads. */
@@ -68,6 +77,9 @@ struct thread_master
struct thread_list event;
struct thread_list ready;
struct thread_list unuse;
+ struct list *cancel_req;
+ bool canceled;
+ pthread_cond_t cancel_cond;
int io_pipe[2];
int fd_limit;
struct fd_handler handler;
@@ -189,7 +201,8 @@ extern void funcname_thread_execute (struct thread_master *,
#undef debugargdef
extern void thread_cancel (struct thread *);
-extern unsigned int thread_cancel_event (struct thread_master *, void *);
+extern void thread_cancel_async (struct thread_master *, struct thread **, void *);
+extern void 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 *);