X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=input.cpp;fp=input.cpp;h=a54e6fb2d398341302f8bbf13bcaa5f5f8239d4d;hp=ccc4bc0134e47870ae5e44f7f5c9210d897260bd;hb=e1722a5c0341fd541ce57f1eed4dc76cbd3efe07;hpb=99738bd173040bf4e2d2d42ffc8c7ab8c105cf75 diff --git a/input.cpp b/input.cpp index ccc4bc0..a54e6fb 100644 --- a/input.cpp +++ b/input.cpp @@ -114,35 +114,6 @@ InputProto Input::serialize() const return serialized; } -void Input::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, Input::do_work_thunk, this); -} - -void Input::stop() -{ - should_stop = true; - - pthread_kill(worker_thread, SIGHUP); - if (pthread_join(worker_thread, NULL) == -1) { - perror("pthread_join"); - exit(1); - } -} - -void *Input::do_work_thunk(void *arg) -{ - Input *input = static_cast(arg); - input->do_work(); - return NULL; -} - int Input::lookup_and_connect(const string &host, const string &port) { addrinfo *ai;