]> git.sesse.net Git - cubemap/blobdiff - stats.cpp
Factor all the common thread starting/stopping into a common Thread class.
[cubemap] / stats.cpp
index 445bae7f3317d8e31bfecaa4a8143d873fb9c367..1ae23e9891a4000f8b75dd66da87c2f080120c25 100644 (file)
--- a/stats.cpp
+++ b/stats.cpp
@@ -18,29 +18,6 @@ StatsThread::StatsThread(const std::string &stats_file, int stats_interval)
 {
 }
 
-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) {