summaryrefslogtreecommitdiffstats
path: root/lib/thread.h
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-11-19 14:11:42 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2014-04-22 21:17:00 +0200
commit4becea724ccd87e88f8454622ae227308b5fa3ce (patch)
treea1e07f06ae43698a72a15ee801de86ce3d9ffdf4 /lib/thread.h
parent514991c76366c2a9f4c644714ad0722df0eed532 (diff)
downloadquagga-4becea724ccd87e88f8454622ae227308b5fa3ce.tar.bz2
quagga-4becea724ccd87e88f8454622ae227308b5fa3ce.tar.xz
lib: use heap to manage timers
Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/thread.h')
-rw-r--r--lib/thread.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/thread.h b/lib/thread.h
index 67902cf6..dbf5f25b 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -44,16 +44,18 @@ struct thread_list
int count;
};
+struct pqueue;
+
/* Master of the theads. */
struct thread_master
{
struct thread_list read;
struct thread_list write;
- struct thread_list timer;
+ struct pqueue *timer;
struct thread_list event;
struct thread_list ready;
struct thread_list unuse;
- struct thread_list background;
+ struct pqueue *background;
fd_set readfd;
fd_set writefd;
fd_set exceptfd;
@@ -80,6 +82,7 @@ struct thread
int fd; /* file descriptor in case of read/write. */
struct timeval sands; /* rest of time sands value. */
} u;
+ int index; /* used for timers to store position in queue */
struct timeval real;
struct cpu_thread_history *hist; /* cache pointer to cpu_history */
char funcname[FUNCNAME_LEN];