X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=acceptor.h;h=97672338a133b0006b9203a8e33903057dd0aa33;hb=7c55e615d7b03fc92b93701ddc3a5d2e6b7087d0;hp=5cd579da11381f731aa9d5d46dcda3a3f9113301;hpb=156897c8a6c7b86cb244d74911528de5c28f2134;p=cubemap diff --git a/acceptor.h b/acceptor.h index 5cd579d..9767233 100644 --- a/acceptor.h +++ b/acceptor.h @@ -1,26 +1,20 @@ #ifndef _ACCEPTOR_H #define _ACCEPTOR_H +#include "thread.h" + int create_server_socket(int port); // A thread that accepts new connections on a given socket, // and hands them off to the server pool. -class AcceptorThread { +class AcceptorThread : public Thread { public: AcceptorThread(int server_sock); - void run(); - void stop(); private: - // Recovers the this pointer, and hands over control to do_work(). - static void *do_work_thunk(void *arg); - - void do_work(); + virtual void do_work(); int server_sock; - - pthread_t worker_thread; - volatile bool should_stop; }; #endif // !defined(_ACCEPTOR_H)