timespec last_modified;
};
- std::string filename, pathname;
+ std::string pathname;
std::shared_ptr<const Image> current_image;
static std::shared_ptr<const Image> load_image(const std::string &filename, const std::string &pathname);
static std::shared_ptr<const Image> load_image_raw(const std::string &pathname);
- static void update_thread_func(const std::string &filename, const std::string &pathname, const timespec &first_modified);
+ static void update_thread_func();
static std::mutex all_images_lock;
- static std::map<std::string, std::shared_ptr<const Image>> all_images;
- static std::map<std::string, std::thread> update_threads;
+ static std::map<std::string, std::shared_ptr<const Image>> all_images; // Under all_images_lock.
+ static bool update_thread_started; // Under all_images_lock.
+ static std::thread update_thread; // Under all_images_lock.
static std::mutex threads_should_quit_mu;
static bool threads_should_quit; // Under threads_should_quit_mu.