X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=stats.h;h=3f5fc0b01807f4b73f890f38b0850d64cd6e0eb3;hp=c4fb17a43362380b7bba98d74079ade7a87733b0;hb=f583e4d329222d8ce2a11524e924c02139b4f28d;hpb=e8eff7cedea352b618b114a4d88bb8110d787e4c 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)