Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::mutex surf_lock;
- // Load all the images.
- for(const auto& f : file_paths) {
- std::thread([&surf_lock, &surfs](const std::string path) {
- surf_lock.lock();
- surface temp = image::get_image(path);
- if(!temp.null()) {
- surfs.push_back({ std::move(temp), path});
- }
- surf_lock.unlock();
- }, f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement