diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2019-01-31 02:30:35 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-04-27 19:33:45 +0200 |
| commit | 7c198e4e1ac07c043ecfc573aed9f1d107f87234 (patch) | |
| tree | fd36815f62a4cfef3cc777813eaea7f906d44d35 /lib/thread.h | |
| parent | c284542b669ffedca07c1a3addfcb3016724b591 (diff) | |
lib: use DECLARE_SKIPLIST for timers instead of pqueue
Replaces the use of pqueue_* for the thread_master's timer list with an
instance of DECLARE_SKIPLIST_*.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/thread.h b/lib/thread.h index 7897265120..bbc953424d 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -41,8 +41,7 @@ struct rusage_t { #define GETRUSAGE(X) thread_getrusage(X) PREDECL_LIST(thread_list) - -struct pqueue; +PREDECL_SKIPLIST_NONUNIQ(thread_timer_list) struct fd_handler { /* number of pfd that fit in the allocated space of pfds. This is a @@ -73,7 +72,7 @@ struct thread_master { struct thread **read; struct thread **write; - struct pqueue *timer; + struct thread_timer_list_head timer; struct thread_list_head event, ready, unuse; struct list *cancel_req; bool canceled; @@ -95,6 +94,7 @@ struct thread { uint8_t type; /* thread type */ uint8_t add_type; /* thread type */ struct thread_list_item threaditem; + struct thread_timer_list_item timeritem; struct thread **ref; /* external reference (if given) */ struct thread_master *master; /* pointer to the struct thread_master */ int (*func)(struct thread *); /* event function */ @@ -104,7 +104,6 @@ struct thread { int fd; /* file descriptor in case of r/w */ struct timeval sands; /* rest of time sands value. */ } u; - int index; /* queue position for timers */ struct timeval real; struct cpu_thread_history *hist; /* cache pointer to cpu_history */ unsigned long yield; /* yield time in microseconds */ |
