]> git.sesse.net Git - cubemap/blobdiff - stats.h
When create_input() fails, give an error message instead of crashing.
[cubemap] / stats.h
diff --git a/stats.h b/stats.h
index c4fb17a43362380b7bba98d74079ade7a87733b0..3f5fc0b01807f4b73f890f38b0850d64cd6e0eb3 100644 (file)
--- a/stats.h
+++ b/stats.h
@@ -1,29 +1,21 @@
 #ifndef _STATS_H
 #define _STATS_H 1
 
-#include <pthread.h>
+#include "thread.h"
 #include <string>
 
 // A thread that regularly writes out statistics, ie. a list of all connected clients
 // with some information about each.
 
-class StatsThread {
+class StatsThread : public Thread {
 public:
        StatsThread(const std::string &stats_file, int stats_interval);
-       void run();
-       void stop();
 
 private:
-       // Recover the this pointer, and call do_work().
-       static void *do_work_thunk(void *arg);
-
-       void do_work();
+       virtual void do_work();
 
        std::string stats_file;
        int stats_interval;
-
-       pthread_t worker_thread;
-       volatile bool should_stop;
 };
        
 #endif  // !defined(_STATS_H)