X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=stats.h;fp=stats.h;h=3f5fc0b01807f4b73f890f38b0850d64cd6e0eb3;hp=c4fb17a43362380b7bba98d74079ade7a87733b0;hb=e1722a5c0341fd541ce57f1eed4dc76cbd3efe07;hpb=99738bd173040bf4e2d2d42ffc8c7ab8c105cf75 diff --git a/stats.h b/stats.h index c4fb17a..3f5fc0b 100644 --- a/stats.h +++ b/stats.h @@ -1,29 +1,21 @@ #ifndef _STATS_H #define _STATS_H 1 -#include +#include "thread.h" #include // 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)