X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=server.cpp;h=d3fbaaff297867b5fe5e4323e04ffd8c4ce3ebb2;hb=e1722a5c0341fd541ce57f1eed4dc76cbd3efe07;hp=aed8779a25a3807c02347f2c19063b581c016b63;hpb=99738bd173040bf4e2d2d42ffc8c7ab8c105cf75;p=cubemap diff --git a/server.cpp b/server.cpp index aed8779..d3fbaaf 100644 --- a/server.cpp +++ b/server.cpp @@ -177,31 +177,6 @@ Server::~Server() } } -void Server::run() -{ - should_stop = false; - - // Joinable is already the default, but it's good to be certain. - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_create(&worker_thread, &attr, Server::do_work_thunk, this); -} - -void Server::stop() -{ - { - MutexLock lock(&mutex); - should_stop = true; - } - - pthread_kill(worker_thread, SIGHUP); - if (pthread_join(worker_thread, NULL) == -1) { - perror("pthread_join"); - exit(1); - } -} - vector Server::get_client_stats() const { vector ret; @@ -215,13 +190,6 @@ vector Server::get_client_stats() const return ret; } -void *Server::do_work_thunk(void *arg) -{ - Server *server = static_cast(arg); - server->do_work(); - return NULL; -} - void Server::do_work() { for ( ;; ) {