+#include <fcntl.h>
+#include <stddef.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pthread.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <vector>
+#include "client.h"
#include "serverpool.h"
#include "stats.h"
{
}
-void StatsThread::run()
-{
- should_stop = false;
- pthread_create(&worker_thread, NULL, do_work_thunk, this);
-}
-
-void StatsThread::stop()
-{
- should_stop = true;
- pthread_kill(worker_thread, SIGHUP);
- if (pthread_join(worker_thread, NULL) == -1) {
- perror("pthread_join");
- exit(1);
- }
-}
-
-void *StatsThread::do_work_thunk(void *arg)
-{
- StatsThread *stats_thread = reinterpret_cast<StatsThread *>(arg);
- stats_thread->do_work();
- return NULL;
-}
-
void StatsThread::do_work()
{
while (!should_stop) {