X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=thread.h;h=26e648e5332d6a3016d0ec59d4a58b58b09033a8;hp=d9b95359aa54828410fa62bd828d59a1f395fd30;hb=5cd46e39b4063d94f6dc559ae350beeb8406a8f9;hpb=e1722a5c0341fd541ce57f1eed4dc76cbd3efe07 diff --git a/thread.h b/thread.h index d9b9535..26e648e 100644 --- a/thread.h +++ b/thread.h @@ -10,6 +10,7 @@ class Thread { public: + virtual ~Thread(); void run(); void stop(); @@ -21,8 +22,14 @@ protected: volatile bool should_stop; + // A pipe that you can poll on if you want to see when should_stop + // has been set to true; stop() will write a single byte to the pipe + // and then close the other end. + int stop_fd_read; + private: pthread_t worker_thread; + int stop_fd_write; }; #endif // !defined(_THREAD_H)