#pragma once #include #include #include #include #include "file.h" #include "hash.h" class HasherThread { public: using getNext_f = std::function()>; using doneCallback_f = std::function)>; HasherThread(std::mutex& mutex, getNext_f, doneCallback_f); ~HasherThread(); void start(); void stop(); void waitfor(); private: void threadLoop(); std::thread thread; std::mutex& mutex; getNext_f getNext; doneCallback_f doneCallback; bool shouldrun = false; };