X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=image_input.h;h=02be497ff40e2dccee5f569a5be2e1e98a6ae4c5;hp=437d9c2db72ace8b45de8698d2f61c2147ce3786;hb=refs%2Fheads%2Fcef;hpb=7a074a020aad29723e028acab76b9edfdd6c5223 diff --git a/image_input.h b/image_input.h index 437d9c2..02be497 100644 --- a/image_input.h +++ b/image_input.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,7 @@ public: private: struct Image { + unsigned width, height; std::unique_ptr pixels; timespec last_modified; }; @@ -38,7 +40,10 @@ private: static std::mutex all_images_lock; static std::map> all_images; static std::map update_threads; - static volatile bool threads_should_quit; + + static std::mutex threads_should_quit_mu; + static bool threads_should_quit; // Under threads_should_quit_mu. + static std::condition_variable threads_should_quit_modified; // Signals when threads_should_quit is set. }; #endif // !defined(_IMAGE_INPUT_H)